Property List

Discussion in 'iOS Programming' started by Peacepun, Jan 18, 2010.

  1. Peacepun macrumors newbie

    Joined:
    Jan 18, 2010
    #1
    This is de scenario I am stuck in.I need to save 50 lines of text and access each line of text after my application launches that is fr a change in control parameter de text on de Iphone should change accordingly(i.e point to de secon text and then third....).Instead f goin fr SQlite 3 I want to store this data in Plist an den access de data accordingly(no changes to de data model required).Initially i thought f creating an instance f dictionary an store string objects(text lines).But de dilemna is how do i go about in creating de Plist for de aforementioned case an access de data durin runtime...A sample code wud b really appreciated.I hv been tryin to get my head around Plist but still I am not able figure out....Thnx a lot fr providin dis platform :)
     
  2. North Bronson macrumors 6502

    Joined:
    Oct 31, 2007
    Location:
    San José
    #2
    If you have an NSDictionary filled only with NSStrings (for the values), there is a very convenient method called writeToFile:atomically: that will send the dictionary to a plist (XML).

    Take a look at the "Property List Programming Guide" for a lot more information about this.
     

Share This Page