Loading array from file [easy?]
Loading array from file [easy?]
- Subject: Loading array from file [easy?]
- From: Kodex <email@hidden>
- Date: Thu, 22 Jul 2004 23:27:41 -0700 (PDT)
I have an array that i write to a file. I want to load
that array back into my program at awakefromnib.
*Using a simple writeToFile command to save the data.
NSMutableArray records;
NSData * tData;
NSMutableArray * tArray;
NSString * errorString;
NSPropertyListFormat format;
//im saving it as a plist cause i didnt know what else
to save it as
tData=[NSData
dataWithContentsOfFile:[NSHomeDirectory()
stringByAppendingPathComponent:@"test/array.plist"]];
tArray= [NSPropertyListSerialization
propertyListFrom
Data:tData
mutabilityOption:NSPropertyListMutableContainersAndLeaves
format:&format errorDescription:&errorString];
records = [[NSMutableArray alloc] init];
records = tArray;
Dosnt seem to work, maybe i am going about this all
wrong or something. Any Pointers? Thanks again everyone!
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.