• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to run progress bar in a separate thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to run progress bar in a separate thread


  • Subject: Re: How to run progress bar in a separate thread
  • From: Jiva DeVoe <email@hidden>
  • Date: Mon, 10 Mar 2008 20:19:56 -0700

Make sure if you're doing this that you're not actually updating the GUI code from your other thread because much of cocoa is not thread safe.

Instead, use the performSelectorOnMainThread... Method to do your update to the progress bar in the main thread.


-- Jiva DeVoe http://www.random-ideas.net

On Mar 10, 2008, at 7:18 PM, Jeff LaMarche <email@hidden> wrote:


On Mar 10, 2008, at 10:08 PM, Nick Rogers wrote:

NSThread has one method:
+ (void)detachNewThreadSelector:(SEL)aSelector toTarget:(id)aTarget withObject:(id)anArgument


But its hard to understand as to how to implement it, since its a class method.


Don't let the fact that it's a class method scare you, just call it on the class object, like:

[NSThread detachNewThreadSelector:@selector(myMethod: toTarget: myClass withObject:nil];

Or, instead of nil,you can supply an object.

Apple actually does a darn good job documenting this whole process in the Threads Programming Guide:

http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/Multithreading.pdf

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Prev by Date: Re: No track index in iTunes SB?
  • Next by Date: Re: NSURLDownload and userInfo
  • Previous by thread: Re: How to run progress bar in a separate thread
  • Next by thread: Re: How to run progress bar in a separate thread
  • Index(es):
    • Date
    • Thread