Tag Archives: NSTimer

iPhone – Stop the Scheduled NSTimer

Yesterday we talk about how to make use of the NSTimer for scheduling a task.
iPhone – NSTimer Example
 

Sometimes, you may want to stop the scheduled task. Then you can use the invalidate method. If you invalidate a unfired NSTimer, that’s fine. But if you invalidate a fired NSTimer, the application will crashed. So how to by pass the problem?
Continue reading iPhone – Stop the Scheduled NSTimer

iPhone – NSTimer Example

If you want to scheduled a task, NSTimer can help you. Here comes the example.

MyViewController.h

...
@interface MyViewController : UIViewController  {
	NSTimer *aTimer;
}
@property (nonatomic, retain) NSTimer *aTimer;
...

 
Continue reading iPhone – NSTimer Example