Threads and UI
Threads and UI
- Subject: Threads and UI
- From: Daniel Todd Currie <email@hidden>
- Date: Thu, 11 Dec 2003 00:37:51 -0800
Apologies for my previous post... (wrong list)
Everyone tells me that it is best to do all UI updating in the main
thread. I have an NSBezierPath that I want to update every 0.01
seconds (achieving an animation). It seems very easy to me to just
place the drawRect: method in a while loop and have it pause for 0.1
seconds in every loop. The only way to do this as far as I can tell is
in a separate thread, since I wouldn't want to have the entire app
pausing for 0.01 seconds while i animate this stupid line. Is this
reasonable/safe?
Otherwise I could set up an NSTimer and call some sort of messenger
method (since I can't call drawRect: with a timer directly), which
seems like a bit of a kludge.
Aside from this specific question, can someone perhaps describe what is
meant by "thread safety" and the potential risks of UI updates outside
of the main thread?
TIA,
Daniel Currie
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.