Importing large datasets on iPhone using CoreData

Posted by Matthes on Stack Overflow See other posts from Stack Overflow or by Matthes
Published on 2010-01-26T16:28:31Z Indexed on 2010/03/26 18:23 UTC
Read the original article Hit count: 335

Filed under:
|
|

Hi there,

I'm facing very annoying problem. My iPhone app is loading it's data from a network server. Data are sent as plist and when parsed, it neeeds to be stored to SQLite db using CoreData.

Issue is that in some cases those datasets are too big (5000+ records) and import takes way too long. More on that, when iPhone tries to suspend the screen, Watchdog kills the app because it's still processing the import and does not respond up to 5 seconds, so import is never finished.

I used all recommended techniques according to article "Efficiently Importing Data" http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/CoreData/Articles/cdImporting.html and other docs concerning this, but it's still awfully slow.

Solution I'm looking for is to let app suspend, but let import run in behind (better one) or to prevent attempts to suspend the app at all. Or any better idea is welcomed too.

Any tips on how to overcome these issues are highly appreciated! Thanks

© Stack Overflow or respective owner

Related posts about iphone

Related posts about import