문제

I am developing a guest list(NSMutableArray) and I would like to know If can I create and save this Array in any kind of external file such as .txt .pdf (or another extension)?

Any ideas for do this??

Thanks a lot.

도움이 되었습니까?

해결책

NSArray (which is what NSMutableArray derives from) has a "writeToURL:atomically:" method, which takes a file URL.

Now, if your array contains ONLY objects of the Objective-C types NSString, NSData, NSDate, NSNumber, NSArray or NSDictionary, you should be okay. If you have some custom objects, you'll need to write archiving / unarchiving coder methods which will allow those custom object's data to be written out to a file and read from a file.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top