开发者

Send a message to object in 10 seconds

开发者 https://www.devze.com 2023-03-18 09:09 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消