Disable Auto-Lock

One of the security features of the iPhone is the Auto-Lock feature, this feature basically locks your phone if you don’t use it for a configured time ( normally one minute). The problem of this feature is that it turns off WIFI or 3G connectivity. This can be hassle when you need to run a long network background process.

In order to avoid this in you application you just need to use the property idleTimerDisabled in the UIApplication class. Here is a example:

[UIApplication sharedApplication].idleTimerDisabled = NO;

Don’t forget to turn it on after your process is done, or else, you can drain the device battery very fast because the device will never idle when running your application.






Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: