• 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: Newbie Question about Converting From NSTextField to NSData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie Question about Converting From NSTextField to NSData


  • Subject: Re: Newbie Question about Converting From NSTextField to NSData
  • From: Kyle Moffett <email@hidden>
  • Date: Thu, 18 Jul 2002 11:56:26 -0400

On Thursday, July 18, 2002, at 10:42 AM, Tom Gray wrote:
> I am reading an NSTextField and want to convert the string value
> into an NSData type.
>
> I know their is a better way.

If you want to keep all the fancy Unicode characters OK, then
use:
[mydata dataUsingEncoding:NSUnicodeStringEncoding
allowLossyConversion:NO]
or
[mydata dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO]
Both of those preserve all the characters entered, rather than
turning A into A

Hope that helps,
Kyle Moffett
_______________________________________________
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.

References: 
 >Newbie Question about Converting From NSTextField to NSData (From: Tom Gray <email@hidden>)

  • Prev by Date: Problem with sheet when app hidden
  • Next by Date: [Something a bit more than OT] Jaguar
  • Previous by thread: Re: Newbie Question about Converting From NSTextField to NSData
  • Next by thread: pdf data parsing
  • Index(es):
    • Date
    • Thread