Re: NSString XOR
Re: NSString XOR
- Subject: Re: NSString XOR
- From: Fritz Anderson <email@hidden>
- Date: Fri, 15 Jul 2005 18:57:23 -0500
On 15 Jul 2005, at 5:38 PM, Derrick Carlin wrote:
How would I do an XOR on two NSStrings?
Strictly speaking, the question does not make sense. NSString is an
abstraction that covers any of a number of possible underlying
representations. An instance is an indexable sequence of Unicode
characters, but the underlying bytes aren't accessible. If you want a
byte buffer full of characters, you have to commit yourself to an
encoding and convert the NSString to an NSData, which will yield your
bytes.
How would I convert NSString into binary and back?
See -[NSString dataUsingEncoding:], <http://developer.apple.com/
documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/
NSString.html#//apple_ref/doc/uid/20000154-dataUsingEncoding_>
and -[NSString initWithData:encoding:], <http://developer.apple.com/
documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/
NSString.html#//apple_ref/doc/uid/20000154-initWithData_encoding_>
-- F
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >NSString XOR (From: Derrick Carlin <email@hidden>) |