Re: Can you bypass a file when using initWithContentsOfFile?
Re: Can you bypass a file when using initWithContentsOfFile?
- Subject: Re: Can you bypass a file when using initWithContentsOfFile?
- From: j o a r <email@hidden>
- Date: Sat, 13 Sep 2003 22:32:59 +0200
Nothing could be simpler:
// Create a property list object
NSArray *arr1 = [NSArray arrayWithObjects: @"A", @"B", nil];
// Create a property list string representation
NSString *propertyListString = [arr1 description];
// Re-create the property list object from the string representation
NSArray *arr2 = [propertyListString propertyList];
It's in the docs if you know where to look... :)
Check the description for the "propertyList" method of NSString.
j o a r
On 2003-sep-13, at 20:04, John Lombardo wrote:
If I have the string I want in memory, is there a means of bypassing
writing
the string to a file and then reading it back with...
[myArray initWithContentsofFile:myFilePath]
I'm sure there must be a means of simulating a file with a data stream
or
something else that hasn't occurred to me yet. Either way, if I can
build an
array using a property list direct from memory (without having to
manually
chop and iterate), I'll be happy :)
_______________________________________________
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.