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: David McGavern <email@hidden>
- Date: Tue, 10 Feb 2004 20:10:20 -0500
To get an NSString (which you can then get a C string from), call:
[myTextView string];
The documentation on NSText (which NSTextView is a subclass of) says
this about the string method:
"Returns the characters of the receivers text. For performance
reasons, this method returns the current backing store of the text
object. If you want to maintain a snapshot of this as you manipulate
the text storage, you should make a copy of the appropriate substring."
Hope that helps!
- David McGavern
On Feb 10, 2004, at 6: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.