Is your call to -setNeedsDisplay being done on the main thread or from your 
background thread. I seem to recall that you get ignored if the call is not 
made on the main thread, so you'd need to use one of the 
-performSelectorOnMainThread:... methods.


On Apr 19, 2011, at 10:51 AM, Frederick C. Lee wrote:

> Simple scenario:  background thread is computing data to be displayed in real 
> time within the main thread.
> Data:  dynamic/variable data  that is converted into a NSString type within a 
> background thread, displayed within a UILabel (or NSLabel) on the main thread.
> 
> My own environment: iOS 4+ (relevant to OS X as well) using Xcode 4+.
> 
> Design: background thread (via NSOperation/NSOperationQueue) sends 
> data/iteration to the main (host) thread via DELEGATION.
> 
> Note: the main thread *** sees **** this data in read time (via NSLog() stmt 
> )....
> 
> However, the front end UIView (or NSView) does NOT update/iteration in real 
> time.
> 
> Paradigm Request:  a real-time digital clock.... tick, tick... you see the 
> seconds being updated.   I need to ditto that with velocity, position, etc.
> I tried the 'setNeedsDisplay' method call; has no effect.
> 
> Question: What is the preferred way to display within the MAIN thread in real 
> time, data that is computed on a back-end thread?

_______________________________________________

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