1

I am developing a desktop-based application in xcode4 that uploads files to ftp, flickr etc. I use multi threading while uploading. I need to cancel the entire uploads going on. Multithreading is done using "performselectorOnMainthread". So I need to cancel each of these runloops from the main thread. I even tried "CFRunLoopStop(CFRunLoopGetMain());" to cancel the main thread itself, but I amnot getting any result.

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
Sugan S
  • 1,782
  • 7
  • 25
  • 47
  • have you tried `+ (void)cancelPreviousPerformRequestsWithTarget:(id)aTarget selector:(SEL)aSelector object:(id)anArgument`? – Mike K Jan 14 '12 at 05:00
  • 1
    `performSelectorOnMainThread:` is not multithreading. Multithreading involves the creation of *another* thread, either directly or through an NSOperationQueue or GCD dispatch queue. – Peter Hosey Jan 14 '12 at 06:01
  • Why would you want to cancel the main thread?! Take a look at the [Cocoa Threading Programming Guide](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Multithreading/). – spudwaffle Jan 14 '12 at 06:22
  • You should read [threading programming guide](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Multithreading/Introduction/Introduction.html#//apple_ref/doc/uid/10000057i-CH1-SW1) – Parag Bafna Jan 14 '12 at 06:23

0 Answers0