iOS4 Create Background Timer

前端 未结 3 1135
余生分开走
余生分开走 2020-12-05 22:09

I (Basically) need to create a background timer on iOS 4 that will allow me to execute some code when a specific amount of time has passed. I have read that you can accompli

3条回答
  •  执笔经年
    2020-12-05 22:52

    You can use those call to execute a method (selector) of an object (toTarget) with some parameter (withObject) in a new thread (detachNewThred).

    Now if you want to execute a delayed task may be the best approach is performSelector: withObject: afterDelay: and the if you want to run the task on background call the detachNewThreadSelector: toTarget: withObject:

提交回复
热议问题