NSTimer

July 21, 2013   ·   0 Comments

http://iphonedevsdk.com/forum/iphone-sdk-development/14403-nstimer-examples.html

@interface className
{
NSTimer * timer;
}

@property (nonatomic, retain) NSTimer * timer;

@end


@implementation className
@synthesize timer;

...

-(void) applicationDidFinishLaunching : (UIApplication *) application {
timer = [NSTimer scheduledTimerWithInterval: 1.0 target:self selector:@selector(targetMethod:) userInfo:nil repeats: YES];

}

//define the targetmethod
-(void) targetMethod: NSTimer * theTimer {
NSLog(@\"Me is here at 1 minute delay\");
}
..
@end
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
iOS Tutorial9

Amazon

adsbygoogle

Recent Posts

Categories

Amazon