PDA

View Full Version : Persistence Storage




priyank.ranka
Dec 5, 2008, 05:33 AM
Hi EveryOne,
I want to store one integer value in some persistence storage..I dont want to use Sqlite3 for it.I want to use plist but i couldnt write data into plist.Please it will be of great help iif some one can provide me basic code of creating reading and writing data into plist.Thanks for ur help.



robbieduncan
Dec 5, 2008, 05:35 AM
Why not just store this single integer in NSUserDefaults? Look it up in the documentation...

priyank.ranka
Dec 5, 2008, 06:19 AM
Actually i want it to be done by plist only so that i can use this only in further games

robbieduncan
Dec 5, 2008, 07:06 AM
Actually i want it to be done by plist only so that i can use this only in further games

Well in that case you should read the appropriate documentation. In this case I'd suggest the File and Data Management (http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/FilesandNetworking/chapter_8_section_2.html#//apple_ref/doc/uid/TP40007072-CH21-SW11) section of iPhone Application Programming Guide which you should have read and understood all of anyway.

fenrus110
Dec 5, 2008, 01:53 PM
i still don't see why you can't use NSUserDefaults. It seems to fit your bill.