I’ll also argue that if you’re needing to do this kind of thing from a 
background thread, your code isn’t factored properly.

Managing the UI of the app is far too complex a task to try to coordinate among 
multiple threads. The current best practices for concurrent programming suggest 
that you should try to minimize the amount of (mutable) state shared between 
threads, and instead have the threads interact mostly by messaging.

So in this specific case, if a background thread does something that requires a 
player view to be resized, it should send a message (or post a block) to the 
main thread and let the main thread do it. (And hopefully the background thread 
isn’t concerning itself with pixels, but instead with something like the length 
of a track or the number of tracks, which the main thread’s UI logic can then 
translate into pixel dimensions.)

—Jens
_______________________________________________

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