how to call a method of multiple arguments with delay

后端 未结 6 571
谎友^
谎友^ 2020-12-13 04:15

I\'m trying to call a method after some delay.

I know there is a solution for that:

[self performSelector:@selector(myMethod) withObject:nil afterDel         


        
6条回答
  •  自闭症患者
    2020-12-13 04:46

    These will all work, but are all much more complex than is needed.

    Design the method to be called with an NSDictionary argument. Put the objects in it you need.

    If you want the method to be accessible by other means as well, call instead a method that 'unwraps' the dictionary and calls the intended method with explicit parameters.

提交回复
热议问题