Re: Getting an NSString out of an NSTextView;
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.