关于 iphone coredata 和 json mysql 的问题
我有一个应用程序,它在 coredata 上保存数据,在“实体”上创建一个条目,将数据保存在适当的属性上,然后将数据发送到 json 以在服务器端使用 php 保存在 mysql 中,
data n1 (x1, x2, x3)....the variables coredata n1 (x1, x2, x3).....variables stored in coredata mysql n1 (x1,x2,x3).....variables stored in mysql (via json)
工作正常,但是,如果互联网连接不可用,将数据发送到服务器进行同步的最佳方法是什么?
我的意思是,如果数据无法发送到 mysql,在 coredata 的节省之一中,
同步未发送的数据的最佳方法是什么?
谢谢你
希望我的问题有意义,
请告诉我需要澄清什么?
多谢!
I have an app that saves data on coredata, creates an entry on the "entity", saving the data on the appropriate properties, and then sends the data to json to be saved in mysql using php on the server side,
data n1 (x1, x2, x3)....the variables coredata n1 (x1, x2, x3).....variables stored in coredata mysql n1 (x1,x2,x3).....variables stored in mysql (via json)
is working fine, but what would be the best way to send the data to the server for synchronization in case the internet connection is not available?
what I mean is, if the data could not be sent to mysql, in one of the savings to the coredata,
what is the best way to synchronize that data that wasnt sent?
thank you
hope my question makes sense,
please tell me what to clarify??
thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有互联网连接,我将在您的应用程序委托中测试reachAbility,创建一个新线程,并在此线程中测试您的数据是否同步。如果没有开始同步数据。
要进行测试,您需要在核心数据中添加一个标志来保留同步状态。
I your app delegate where you test for reachAbility if you have internet connection create an new thread and in this thread test is your data is synced or not. If not start to sync data.
To test you need to add an flag in your core Data that will keep the status of your sync.