• 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: NSString XOR
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSString XOR
      • From: Allan Hsu <email@hidden>
References: 
 >NSString XOR (From: Derrick Carlin <email@hidden>)

  • Prev by Date: Bindings crash - _NSKeyValueObservationInfoCreateByRemoving calls CFRetain(NULL)
  • Next by Date: NSTreeController, setObjectClass and selection
  • Previous by thread: NSString XOR
  • Next by thread: Re: NSString XOR
  • Index(es):
    • Date
    • Thread