• 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
NSTextStorage insertion point
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextStorage insertion point


  • Subject: NSTextStorage insertion point
  • From: Ben <email@hidden>
  • Date: Tue, 23 Mar 2010 20:04:23 +0000

Hi list.

I've got an NSTextView subclass which implements the NSTextStorage delegate method -textStorageWillProcessEditing:. In that method I do syntax highlighting and also replace certain substrings with text attachments (a bit like Xcode's autocomplete placeholders).

The problem is that the insertion point is always moved to the end of the text view each time this method is invoked. It seems to happen whenever I modify the attributes of the text, not when I modify the text contents.

Storing the insertion point and restoring it at the end of -textStorageWillProcessEditing or in -textStorageDidProcessEditing still result in the insertion point being moved to the end sometime later. There are other threads online with this problem, but they are old and have no solutions.

Does anyone have any suggestions on how to avoid or work around this problem?

- Ben_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSTextStorage insertion point
      • From: Gideon King <email@hidden>
  • Prev by Date: Re: find panel buttons not enabling
  • Next by Date: Re: CoreData database sharing and migration
  • Previous by thread: [MEET] Toronto Cocoaheads / tacow - April 13
  • Next by thread: Re: NSTextStorage insertion point
  • Index(es):
    • Date
    • Thread