Re: NSString to bit pattern
Re: NSString to bit pattern
- Subject: Re: NSString to bit pattern
- From: Andrew Farmer <email@hidden>
- Date: Fri, 8 May 2009 15:00:49 -0700
On 08 May 09, at 08:47, Greg Guerin wrote:
A string is a sequence of characters. Retrieve each character,
determine its bit-pattern, then append that pattern to an
NSMutableString. Now you have to figure out how to turn a character
into its bit-pattern. So break that down.
One extra complication: By Cocoa's standards, a string is not a
sequence of bytes: it's a sequence of Unicode codepoints.* To treat a
string as a "bag of bytes", you will first need to choose a text
encoding to treat the text as, then convert it using the NSString
dataUsingEncoding: method.
If all you're working with is standard ASCII characters, though, this
shouldn't be an issue.
_______________________________________________
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