• 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
Re: Can you bypass a file when using initWithContentsOfFile?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Can you bypass a file when using initWithContentsOfFile? (From: John Lombardo <email@hidden>)

  • Prev by Date: Re: Calling Cocoa APIs from a command line application
  • Next by Date: [ANN] AGRegex 0.4
  • Previous by thread: Can you bypass a file when using initWithContentsOfFile?
  • Next by thread: [ANN] AGRegex 0.4
  • Index(es):
    • Date
    • Thread