When i keep my application open for awhile, the iPhone/iPod locks the screen. When i unlock it my application gets stuck for like 2 seconds and then it resumes and keep functioning as usual. Why is this ? and how can i prevent it ?
To prevent this from hapenning is there any PLIST
method where we could stop the process of the application when it goes to a locked screen (Might not be a better idea)
applicationDidReceiveMemoryWarning
should help you to verify if its memory issue. Also as @Alex states you can goto Product > Profile > Leaks
to track memory leaks - Illep 2017-06-20 05:42
I'm not quite sure about the answer for your first question (you maybe do some heavy things inside the applicationDidBecomeActive method or the app simply reallocates memory), but i can answer the second one.
You can simply prevent the auto lock by calling:
[[UIApplication sharedApplication] setIdleTimerDisabled: YES];
A good palce for this is inside the applicationDidFinishLaunching
method of the app delegate.
In your application delegate do you have any code that could slow down your app? Check the following methods?
Also use the above methods ensure you application suspends properly.
Log when your app receives a memory warning inside:
-(void) applicationDidReceiveMemoryWarning:(UIApplication *)application
Maybe when you suspend or reopen your app some there is a memory issue.
applicationDidReceiveMemoryWarning
method - Illep 2012-04-05 18:07