开发者

Array writeToFile

Let's say I create an object like this:

Person:
NSString *name;
NSString *phone;
NSString *address

I create several of these objects. Then I create an NSMutableArray called people and store them in there.

Can I save this array to disk wi开发者_Go百科th Array writeToFile? Does it need to be converted to NSData?


Any objects in your NSArray must be an NSString, NSDate, NSArray, NSDictionary, NSNumber or NSData for writeToFile to succeed.

Yes, you will need to archive each Person object to an NSData object before you put it into the array.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜