• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Loading array from file [easy?]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
propertyListFromData: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.


  • Follow-Ups:
    • Re: Loading array from file [easy?]
      • From: Larry Fransson <email@hidden>
  • Prev by Date: NSTextFieldCell not honoring -setScrollable:?
  • Next by Date: Re: July ADC Mailing
  • Previous by thread: NSTextFieldCell not honoring -setScrollable:?
  • Next by thread: Re: Loading array from file [easy?]
  • Index(es):
    • Date
    • Thread