iphone - Persisting a datasource between multiple views without shared root view controller -
i'm working on app uses uinavigationcontroller
inside uitabbars
. tab bars correspond both uitableviews
map view. however, root view controller of app not parent, or direct parent, of uitableview
custom controllers , map view controller. have p-list creates nsdictionary
objects; datasource using populate entries in tables , map.
so, without root view controller, how should create nsdictionary
objects data source? seems me easiest way recreate object in each view controller view needs data. because don't have many views , p-list isn't long, memory shouldn't issue. however, know inefficient.
is there alternative implementation don't have recreate nsdictionary
in each view controller?
this tutorial featuring singleton guide neatly explains everything: http://www.cocoanetics.com/2009/05/the-death-of-global-variables/
my worry if multiple view controllers each call singleton, wouldn't generating multiple instances of nsdictionary
, , couldn't conceivably still take lot of memory?
in practical terms, data model either placed in kind of singleton (either own, or app delegate kind of singleton).
Comments
Post a Comment