开发者

Doing work that takes a long time when app has been backgrounded

I want a method to work in background until a duration specified by the user (let's say 20 minutes) elapses. I know it's not possible, because Apple allows the app to work for a maximum of 10 minutes in the background. Unfortunately FireDate works with UILocalNotifications only. I also read about performSelector:Selector:WithObject:afterDelay: method but I'm not sure if that will work in the background 开发者_如何学编程or not. Kindly give me suggesstions and code snippets (if any).


two methods that will be of use:

NSObject -(void)performSelectorInBackground:(SEL)aSelector withObject:(id)arg

UIApplication - (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler:(void(^)(void))handler

local notifications can be used if you want the user to re-launch, but if they don't click through to the app, then your app never knows about it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜