On Sep 26, 2008, at 11:22 AM, j o a r wrote:


On Sep 25, 2008, at 6:22 AM, Steve Rossi wrote:

I've deduced that he crash seems to be something timing related which occurs only at application startup, and only under certain conditions (i.e. reproduce occassionlly by opening an NSOpenPanel modal dialog before the application is fully up and running). When I say the application is fully up and running, I mean a secondary thread has retrieved data from a network source and populated a model class. This secondary thread cyclically updates the data about 8x per second by means of a timer in the secondary thread's run loop. I use Cocoa bindings to display the data in the UI. I'm sure the problem is happening in the bindings, but I'm having trouble finding where.


In the general case, and with few exceptions, you can't call your UI on non-main threads. This means that you can't drive UI updates based on KVO notifications from non-main threads. Could this be your problem?

j o a r


Yes, that is correct. A separate thread is spawned which updates the model - consequently driving UI updates based on KVO notifications. It is the only thread that is updating the model - the main thread does very little except respond to fairly minimal UI events. It works very reliably it seems ... except on these occassions when the OpenPanel is opened from the main thread. I can think through whether I really need that separate thread. But is there a way to make the model updates from the 2nd thread safe?

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to