Converting NSArray of NSString elements into binary?
Converting NSArray of NSString elements into binary?
- Subject: Converting NSArray of NSString elements into binary?
- From: "R.L. Grigg" <email@hidden>
- Date: Mon, 1 Oct 2007 16:28:19 -0700
Newb Cocoa question:
I have many lines of textual ascii data in a file that i need to scan
into a NSData as binary:
000 255 127 255 066 033 127 000 221 ...
This data can go for more than 1000 values per line.
Currently I read each line into a NSString and parse the data into a
NSArray:
NSString *list = @"000 255 127 255 066 033 127 000
221 ..."; // example data
NSArray *listItems = [list componentsSeparatedByString:@" "];
Is there some method to convert the NSArray of NSString elements into
binary byte values? Or do I have to go through each element and
convert each NSString into a NSNumber so I can put it's byteValue
into a NSMutableData one by one? Is this the wrong approach?
Russ
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden