开发者

iPhone Objective C - Saving Data

开发者 https://www.devze.com 2023-01-10 10:03 出处:网络
I have a NSMutableArray of some instances of a custom class (it has a NSString, CGPoint, and a UILabel).

I have a NSMutableArray of some instances of a custom class (it has a NSString, CGPoint, and a UILabel).

I need to save this array. I tried using writeToFile:Atomically: but that doesn't work with custom classes (I think). Is there any other simple way开发者_高级运维 to save that? And how would i load it?

Thanks everybody in advance:) Any ideas, suggestions, pointers


You can use NSCoding to help with this, but I think you'll find it tricky to deal with the semantics of saving and restoring UILabels. Would it not be possible just to store them in a nib file?

0

精彩评论

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