Re: Text Storage
Re: Text Storage
- Subject: Re: Text Storage
- From: Scott Anguish <email@hidden>
- Date: Fri, 9 Aug 2002 16:35:02 -0700
What you'll need to do is find the end of the first line, and then do a
theRange=[[myTextStorage string] rangeOfString:@"\n"];
[myTextStorage deleteCharactersInRange: theRange];
that should delete the first line
The interesting stuff comes into handling deleting the first sentence
or paragraph from something, since thelanguage semantics come into play.
On Friday, August 9, 2002, at 12:52 PM, Nico wrote:
Hi.
Is there any way I can delete the first line of an NSTextView's
textStorage?
Saying "the first line" I mean :
[[[myTextStorage componentsSeparatedByString:@"\n"] objectAtIndex:0]
I tried the docs, but I just managed to replace this line by an empty
one.
That's not what I need, I want the second line to become the first one,
etc..
_______________________________________________
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.