• 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: Text Storage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Text Storage
      • From: Nico <email@hidden>
References: 
 >Text Storage (From: Nico <email@hidden>)

  • Prev by Date: Re: FTPClient Beta Released - Please test
  • Next by Date: NSMatrix programatic creation question
  • Previous by thread: Text Storage
  • Next by thread: Re: Text Storage
  • Index(es):
    • Date
    • Thread