views:

37

answers:

1

Hi, everyone,

I want to ask a question about the iPhone plist. What is the size of the plist in each iPhone application? Thank you.

+3  A: 

That depends on the infos stored in the plist, as it is merely a container format. It's like asking, "What is the size of a XML file ?".

DarkDust
@DarkDust, thank you for your reply. I have an 2000 elements in the array. And each of the element is an object which contains 3 data members. Is it possible to store it?
Questions
Of course, no problem with that. There are even very convenient methods to do so: -[NSArray writeToFile:atomically:] (http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/occ/instm/NSArray/writeToFile:atomically:) and +[NSArray arrayWithContentsOfFile:] (http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/occ/clm/NSArray/arrayWithContentsOfFile:)
DarkDust
Only constraint is that every object stored in the array (and arrays/dictionaries contained in that array) have the NSCoding protocol implemented. That's true e.g. for NSArray, NSDictionary, NSString, NSNumber, NSData, ...
DarkDust
@DarkDust, thank you very much. Is it possible to stored the user-defined object (e.g. book - name, publish, price)?
Questions
Yes, your objects just need to comply to thr NSCoding protocol. Read the reference of NSCoding for details, it's actually pretty easy.
DarkDust
@DarkDust, thank you very much.
Questions