Re: Possible causes of "attempted layout while textStorage is editing"?
Re: Possible causes of "attempted layout while textStorage is editing"?
- Subject: Re: Possible causes of "attempted layout while textStorage is editing"?
- From: Gideon King <email@hidden>
- Date: Thu, 01 Sep 2011 22:31:41 +1000
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, email@hidden 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 (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