Re: data->array (!@%$*)
Re: data->array (!@%$*)
- Subject: Re: data->array (!@%$*)
- From: Sherm Pendley <email@hidden>
- Date: Fri, 14 Jun 2002 16:31:11 -0400
On Friday, June 14, 2002, at 02:14 PM, Mathieu Labrie wrote:
I have a problem with NSData values and NSArray ones. I'm
retrieving data from a socket but then I have to store the different
strings contained in the data into an array to use them later in my
application. I tried to write the data into a file but it's not the
same encoding as NSArray and I simply can't get my string values with
the normal "arrayWithContentsOfFile:" thing..
If you're splitting the data into an array of strings that are separated
by a known character, for example lines of text separated by carriage
returns/linefeeds, or fields within a line separated by tab characters,
you could create a string containing the data using the NSString class'
initWith
Data:encoding: method, then split the resulting string into an
array with the componentsSeparatedByString: method.
P.S Sorry for the spelling or syntax error but english is not my main
language :o)
Your English is much better than my French! My own main languages are
Perl and Objective-C, with English a rather distant third. ;-)
sherm--
Never put off until tomorrow what you can do today. There might be a law
against it by that time.
_______________________________________________
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.