• 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: Getting an NSString out of an NSTextView;
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting an NSString out of an NSTextView;


  • Subject: Re: Getting an NSString out of an NSTextView;
  • From: Ryan Bates <email@hidden>
  • Date: Tue, 10 Feb 2004 17:03:59 -0800

There's no need to dig around the NSTextStorage. The [textView string] method returns an NSString of the text view's contents so [[textView string] UTF8String] should work.

Note from Apple's docs:
"Use of this method (NSString cString) is discouraged as it will be deprecated in the near future. Instead it is recommended to use UTF8String to convert arbitrary NSStrings to a lossless 8-bit representation."
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Classes/NSString.html>

Ryan


On Feb 10, 2004, at 3:59 PM, Robert Tillyard wrote:

I have an NSTextView which the user enters text, I need to pass the contents as a "const char *" to a 'C' library to save to an ISAM database.

How do I get the the [NSString cString]? I seem to need to navigate NSTextStorage but I'm getting lost in the documentation.

Thanks, Regards, Rob.
_______________________________________________
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.
_______________________________________________
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: 
 >Getting an NSString out of an NSTextView; (From: Robert Tillyard <email@hidden>)

  • Prev by Date: Re: Making the correct button the default button?
  • Next by Date: Re: Getting an NSString out of an NSTextView;
  • Previous by thread: Re: Getting an NSString out of an NSTextView;
  • Next by thread: Re: Getting an NSString out of an NSTextView;
  • Index(es):
    • Date
    • Thread