Send a message to object in 10 seconds
I want to send message to object in every 10 seconds. I want to do something like this [object message];
.How can I do that? Thanks in advance开发者_C百科
You can use an NSTimer
. Example.
[NSTimer scheduledTimerWithTimeInterval:10
target:object
selector:@selector(message)
userInfo:nil
repeats:YES];
You are recommended to use a selector of the form - (void)timerMethod:(NSTimer *)timer
but this works too.
精彩评论