I don't have a lot of experiencing debugging deadlocks.  The commitEditing call 
never returns, just spinning beach ball, so that makes it difficult to debug.
I did notice that edits before a certain number of characters commits fine 
after that - deadlock.  Weird.

On Dec 22, 2010, at 12:27 PM, Douglas Davidson wrote:

> 
> On Dec 21, 2010, at 8:08 PM, Brad Stone wrote:
> 
>> I have an NSTextView that has about 1,900 characters in it.  Just regular 
>> text.  If I edit the text and save my app hangs at  [[self 
>> managedObjectContext] commitEditing];  I found setting nonContinuousLayout 
>> to NO in the NSTextView prevents the hang but that's not really solving the 
>> problem.
>> 
>> Here's what's strange.  If I expand the window so the all the text shows 
>> without the scroll bar it doesn't hang.  If I edit the same text but scroll 
>> down the get it I get a hang.  If I set nonContiguousLayout to NO it doesn't 
>> hang in either scenario.
>> 
>> What advice can anyone give as to how I can address this problem?
> 
> The obvious workaround to try would be to call [layoutManager 
> ensureLayoutForCharacterRange:NSMakeRange(0, textLength)] at some point 
> before you save.  That will cause the entire text to be laid out, as it would 
> be if the window showed all of it.  It would also be helpful if you could 
> file a bug with enough information to reproduce this.
> 
> Douglas Davidson
> 

_______________________________________________

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