问题
I would like to schedule tasks in iOS to execute a method depending on the time of the day and the day. For example, I want to execute startMonitorRegion every day at 10pm and stopMonitorRegion at 10am. I don't want to send a local notification to alert the user, it needs to be transparent for the user.
Is anyway to do it using NSTimer? The app will be in background.
回答1:
You can utilize Local notifications for this purpose.
Just schedule local notification for some date/time. and once user open your app you can perform the required task..
来源:https://stackoverflow.com/questions/13527487/schedule-tasks-to-execute-methods-in-ios