Should I use Core Data or NSCoding to preserve a table view controller's
data?
This is a pretty basic question, but I have searched all over for an
answer that caters to my situation and found little.
I'm using ECSlidingviewController to make a left drawer/menu control like
Facebook, Pulse, and many others. (Actually quite surprised this isn't
part of the Apple SDK)
When I select an option from my menu controller, it pops the current top
controller off, and pushes the view controller selected by menu. My main
view is a tableview of local places, and its quite expensive/time
consuming to retrieve local spots from a server every time the view is
loaded, so I'd like to save the last loaded collection object (My object
that wraps a dictionary with simple accessor methods).
I've explored NSCoding/NSKeyed* and Core Data so far and NSCoding seems
like a good plan, but I'm not sure if it would be suited to 30 entries of
custom objects (each has 640x320 picture and a few strings). At the same
time, using core data for a simple collection object seems like building a
mansion for a closet. I've also considered trying to keep the view
controller around in memory, but that seems way too wasteful. Also,
NSUserDefaults doesn't seem to fit the job either. Would the UIKit state
preservation techniques work even when the app is in foreground? And
finally- would NSURLCache be a good solution to saving the tableview data?
All I want is a quick and standardized way to reload my tableview's last
data source without any network requests, or 100 lines of code.
No comments:
Post a Comment