title: NSRunLoop cancelPerformSelectorsWithTarget's not working
body: <p>I have this following code and I am not getting the results I expected.</p>
  
  <pre><code>#import "CancelPerformSelectorTestAppDelegate.h"
  @implementation CancelPerformSelectorTestAppDelegate
  @synthesize window;
  
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
      [window makeKeyAndVisible];
      for(unsigned int i = 0; i &lt; 10; i++){
          NSTimeInterval waitThisLong = i;
          [self performSelector:@selector(foo) withObject:nil afterDelay: waitThisLong];
      }
  
      [[NSRunLoop currentRunLoop] cancelPerformSelectorsWithTarget: self];
  
      return YES;
  }
  
  - (void) foo {
      static unsigned int timesCalled = 0;
      ++timesCalled;
      NSLog(@"%s: I am called for the %d-st/nd/th time", __func__, timesCalled);
  }
  
  - (void)applicationWillResignActive:(UIApplication *)application {}
  - (void)applicationDidBecomeActive:(UIApplication *)application {}
  - (void)applicationWillTerminate:(UIApplication *)application {}
  - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {}
  - (void)dealloc {
      [window release];
      [super dealloc];
  }
  
  @end
  </code></pre>
  
  <p>I expected the function to be called about 0 times, perhaps 1 if the CPU is having a slow day.</p>
  
  <p>The function will execute 10 times! :( Always. What am I doing wrong, and how could I achieve the results I expected?</p>
  
  <p>Thanks in advance, a lot, 
  Nick</p>