Hmmm, I see that there is a place in my code where they can be editing the text 
view, and then they mouse down in its containing view, and that triggers an 
event to be posted through NSApp at the end of the event queue and an 
autorelease being sent to the enclosing view which would eventually result in 
the text view being removed, while that event could trigger a 
glyphRangeForTextContainer call. I guess that might leave things open to the 
possibility of something still being edited when I am working with the text. 

I think I'll try using ensureLayoutForTextContainer: and then removing the text 
view from its superview, so nothing else can possibly happen to the text after 
that (I hope...)

Thanks for your help with this Jonathan.

Gideon




On 01/09/2011, at 8:52 PM, jonat...@mugginsoft.com wrote:

> 
> 
> Is it possible that the user is editing the textview when this code is 
> triggered?
> From the looks of the trace you react directly to the mouseDown event in 
> another view which might not give NSTextView opportunity to conclude its edit.
> I would schedule my layout manipulation on the runloop and see if that  helps.
> 
> Regards
> 
> Jonathan
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to