> Do you have any secondary threads? I assume you do.

Indeed!

> Any code that touches a view, no matter how indirectly, could be the culprit. 
> Bear in mind that sending any message to any view (controls, etc) might 
> invoke -setNeedsDisplay: which in turn could be the trigger for the problem. 
> Try setting a breakpoint on -setNeedsDisplay: though of course it will be hit 
> a lot, so you might need a clever condition to avoid being overwhelmed. Even 
> one that excludes the main thread might help, e.g. [NSThread currentThread] 
> != [NSThread mainThread]

That suggestion for a breakpoint is a great one. Sadly the condition you quoted 
doesn't seem to be parsed correctly by the debugger, even with casting. Even 
just "po (NSThread*)[NSThread currentThread]" fails on my machine.

Fortunately, though, there were only a couple of dozen hits on the breakpoint 
per iteration of the code, and sure enough it immediately pinpointed a case 
where I was erroneously calling willChangeValueForKey from a secondary thread, 
which was causing a GUI update as a side-effect.

Cheers
Jonny.
_______________________________________________

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

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

Reply via email to