How to use performselector to involve the function with argument after particular time period

牧云@^-^@ 提交于 2019-12-20 06:36:53

问题


I am new to this iPhone app programming. I have a function with one argument type as structure pointer. This is shown below

(void)responce:(structurePtr *)someData
{
......
......
}

I want to call this function using performselector method after 5 seconds of time interval. Please tell me how to call above responce function using performselector

Thanks in advance.


回答1:


Use: - (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay

[yourObject performSelector:@selector(responce:) withObject:someData afterDelay:5];

Note: it is not guaranteed that your selector will be performed exactly after 5 seconds - it just specifies the minimum time before the message is sent to your object.



来源:https://stackoverflow.com/questions/1906019/how-to-use-performselector-to-involve-the-function-with-argument-after-particula

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!