0

I am runnig an app and testing in device. When user clicks on button content will be updated.It takes time to update.If the iPad is locked the content will not be updated and app crashes. Can any on help me.

Is there any code to make iPad unlock antil content is loaded.

shireasha
  • 151
  • 1
  • 2
  • 10
  • I dont think there is a way for an app to block the auto locking process unless jailbroken maybe, but you should put some logic in your app delegates `applicationDidEnterBackground:` method that will pause or stop your update process so it wont crash – Fonix Apr 09 '14 at 09:09
  • can I have some examples related to applicationDidEnterBackground: – shireasha Apr 09 '14 at 09:11
  • 1
    it would be quite specific to your problem, so i wouldnt really be able to help you with that unless you show us why your app is crashing – Fonix Apr 09 '14 at 09:12

1 Answers1

0

This is possible without a jailbreak. XBMC Official remote has the feature.

It might not stop the locking feature - it stops the dimming of the screen. But I think its what you're looking for.

[UIApplication sharedApplication].idleTimerDisabled = YES;

From the documentation:

Important: You should set this property only if necessary and should be sure to reset it to NO when the need no longer exists. Most applications should let the system turn off the screen when the idle timer elapses. This includes audio applications. With appropriate use of Audio Session Services, playback and recording proceed uninterrupted when the screen turns off. The only applications that should disable the idle timer are mapping applications, games, or similar programs with sporadic user interaction.

Robert J. Clegg
  • 7,231
  • 9
  • 47
  • 99