Reputation: 1555
I have an iPhone application in which I would like to give the user the option of turning a setting on/off depending on wether or not they would like the application to exit when suspended (or going into the background).
As I understand it, there is an option in the info.plist file called something like "UIApplicationExitsOnSuspend" which can be turned on to allow this functionality, I also understand the info.plist file shouldn't (can't?) be modified at run-time.
Though not a massively important feature, I would like to find a way to implement something if possible, can anyone shed some light on this?
Jack
Upvotes: 1
Views: 2885
Reputation: 4546
You're right on the read-only state of the plist at runtime.
You could try something like
-(void)applicationDidEnterBackground:(UIApplication *)application {
if (...) {
exit(0);
}
}
But apple is not happy (= rejects apps) that do not comply to their App Submission Guidelines and 10.1 in particular:
10.1: Apps must comply with all terms and conditions explained in the Apple iPhone Human Interface Guidelines and the Apple iPad Human Interface Guidelines
Upvotes: 0
Reputation: 69469
You should not to that.
First of the UIApplicationExitsOnSuspend
is a settings in the apps info.plist which is read only thus can not be changed.
Also there is not need to exit your app, just let it be pushed to the background. If the systeem need more memory it will kill your to free the memory it is using.
Upvotes: 2