开发者

Core Data on device vs simulator

开发者 https://www.devze.com 2022-12-20 12:26 出处:网络
I have a simple Core Data application, with a table view and a drill down view. When I build and run in the simulator, all of the data in my database loads and the table view/drill down views function

I have a simple Core Data application, with a table view and a drill down view. When I build and run in the simulator, all of the data in my database loads and the table view/drill down views function properly.

When I build and deploy to a device, my application only loads a small subset of the data (a few sections, A - C).开发者_StackOverflow社区 I have no warnings nor build errors. Has anyone run into this problem? Any suggestions?


While I have not run into that issue, I would debug this using log statements. Put in logs through your loop, at the end of the NSURLConnection (assuming you are getting the data from the net) and see what is coming down, etc.

There is no reason for the default to be limiting the data and contrary to some other advice, you have at least 20mb of RAM to use even on the first device. Plenty of room to load a ton of data. Spit out the data stream to the console from the phone and see what you are getting. That is where I would look first.


I think what @theband might be talking about is the fetchLimit property of NSFetchRequest (and it's corresponding property fetchOffset). With these you can have more control over the fetching, and if you have a considerable amount of data, you will need to do that since you can't really plan on having more than about 8MB of RAM for your app on most devices.


The problem is with the device as sometimes it does not load the entire data. The solution would be checking on the limitation of data.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号