• 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: Suggest reasons for this crash?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggest reasons for this crash?


  • Subject: Re: Suggest reasons for this crash?
  • From: Graham Cox <email@hidden>
  • Date: Wed, 7 Oct 2009 12:14:18 +1100

Thanks Kyle - that's really helpful.

I hadn't read the subclassing notes because I'm not subclassing. My model stores attributed strings (pity there's not a - setAttributedString: method on NSTextView that would deal with all the kinks necessary). I'd also missed the discussion on this method because I didn't know I needed to be using it - why read it if you don't need it, and how do I know I need it unless something else says so? - a typical chicken-and-egg situation.

Anyway, hopefully this will fix the problem. Thanks again.

--Graham


On 07/10/2009, at 12:01 PM, Kyle Sluder wrote:

On Tue, Oct 6, 2009 at 5:53 PM, Graham Cox <email@hidden> wrote:
Aha! Thanks - can you point me to the relevant documentation on that? I was
working on the principle that methods like this were high level and were
managing that before-and-after notification/setup stuff for me.

First Google result for "shouldchangetextinrange": Text Editing Progamming Guide, Subclassing NSTextView, Notifying about Changes to the Text. http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/TextEditing/Tasks/Subclassing.html

Also in the documentation for
-shouldChangeTextInRange:replacementString: (but if you know to look
there you probably already know the solution).

This is something you need to check for whenever you might possibly
ever hook up a text view (including the field editor!) to a text
storage.  So if you're storing text storages in your model, for
example, like in a word processor.  This isn't going to show up if
you're just using -setString: (the typical case).

--Kyle Sluder

_______________________________________________

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: Suggest reasons for this crash?
      • From: "Adam R. Maxwell" <email@hidden>
References: 
 >Suggest reasons for this crash? (From: Graham Cox <email@hidden>)
 >Re: Suggest reasons for this crash? (From: Kyle Sluder <email@hidden>)
 >Re: Suggest reasons for this crash? (From: Graham Cox <email@hidden>)
 >Re: Suggest reasons for this crash? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Suggest reasons for this crash?
  • Next by Date: "remote" binding problem
  • Previous by thread: Re: Suggest reasons for this crash?
  • Next by thread: Re: Suggest reasons for this crash?
  • Index(es):
    • Date
    • Thread