Re: Suggest reasons for this crash?
Re: Suggest reasons for this crash?
- Subject: Re: Suggest reasons for this crash?
- From: "Adam R. Maxwell" <email@hidden>
- Date: Tue, 06 Oct 2009 19:54:56 -0700
On Oct 6, 2009, at 6:14 PM, Graham Cox wrote:
> 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.
I think it's worth noting that Apple's code examples don't do this:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/TextArchitecture/Tasks/SimpleTasks.html
The way I read the page Kyle linked to and http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/TextEditing/Tasks/BatchEditing.html is that this is only for user-initiated changes (which may or may not be appropriate, depending on what you're doing).
If this is really necessary, hopefully it'll be documented, or one of the text system guys can step in and clarify...I'd really like to know since I've been doing this for years without calling shouldChangeTextInRange:replacementString:.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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