i have table (dictionary of dictionaries) store mapping of integers strings. have types , sub-types. e.g. type 1=>fruits , sub-type 1=>apple.
the mapping shall configurable in setting interface, reset of application, it's rather static. don't want read property-list every time check mapping. i'd read once when program starts , write when user changes setting.
where should keep table @ runtime? have 2 approaches in mind: (1) put entire table variable in application delegate, in case, need use objectforkey twice every time need string. (2) create class static variable (not sure how yet) , use class method mapping e.g. +(nsstring) stringfortype: subtype:
could please evaluate these 2 approaches or suggest better solutions? lot!
it doesn't matter put it, long keep 1 copy of it, important thing should check out valueforkeypath:. if store in plist, , save plist regularly have great benefit of persistence. can automatically [nsuserdefaults standarduserdefaults];
object.
Comments
Post a Comment