Re: NSTimer, and NSTimeInterval help?
Re: NSTimer, and NSTimeInterval help?
- Subject: Re: NSTimer, and NSTimeInterval help?
- From: Marco Masser <email@hidden>
- Date: Sat, 19 Jul 2008 23:43:08 +0200
Should I also use NSRunLoop?
Whether you have to do something with run loops depends on what
exactly you want to do. Maybe the default behaviour you get by using
one of the -scheduledTimer... methods is already what you need.
Take a look at the docs for NSTimer and NSRunLoop:
http://developer.apple.com/documentation/Cocoa/Conceptual/Timers/Timers.html
http://developer.apple.com/documentation/Cocoa/Conceptual/InputControl/InputControl.html
Also, the signature, "- (void)doSomething:(NSTimer *)theTimer" is
confusing me. Where should I use it? Should I use it in the same
[NSTimer scheduledTimerWithTimeInterval.....] place, or should I use
it in the - (IBAction)startWatch place?
Again, take a look at the docs.
An NSTimer fires after the time you specified. When you are using a
timer, you want a certain method to be called after the time you set.
This method is the one you specify when creating your timer, whereas
this method must have a certain signature to work. Obviously, you
don't call this method directly, it will be called when your timer
fires.
_______________________________________________
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