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

后端 未结 1 1122
不思量自难忘°
不思量自难忘° 2021-01-27 06:32

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 *)someDa         


        
1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-27 06:58

    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.

    0 讨论(0)
提交回复
热议问题