问题
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