views:

1202

answers:

3

Hi all,

I set the UIApplicationExitsOnSuspend to boolean and checked the checkbox, so I assumed that

- (void) applicationDidEnterBackground:(UIApplication *)application

is not called - but I always get into that method when I click the home button in my simulator. Am I doing something wrong or can I be sure that the app will behave the "old style" and does not support multitasking?

Thanks a lot,

Stefan

Settings defined at this level
Architectures: Standard
Base SDK: iPhone Simulator 4.0
Code Signing Identity: iPhone Developer: myName
Any iPhone OS Device: iPhone Developer: myName
iPhone OS Deployment Target: iPhone OS 3.1
Other Linker Flags: -lxml2
Prebinding: not selected
Header search paths: /usr/include/libxml2
C language dialect: C99 [-std=99]
Mismatched Return Type: selected
Unused variables: selected

+3  A: 

One difference I have found to test this is using the iPhone 4 Simulator or Device connected to the Xcode debugger. If you have it enabled properly, when you hit the home button it will exit the debugger. If "multitasking" is enabled, when you hit the home button, the debugger will not exit - touching your icon and bringing it back will continue with your debugging session.

Eric
hm... I'm using Device "iPhone 4" but debugger is ALWAYS exited, no matter how I configured the property. Base SDK "iPhone Simulator 4.0" and "iPhone OS Deployment Target" "Compiler Default" (there is no version 4, the highest is 3.2). Am I missing something?
swalkner
Something doesn't sound right - you've got Xcode 3.2.3? I set my Base SDK to "iPhone Device 4.0" and the "iPhone OS Deployment Target" to "iPhone OS 3.1". Where is there no "version 4"?
Eric
I also set Base SDK to "iPhone Device 4.0" and "iPhone OS Deployment Target" to "iPhone OS 3.1". In my simulator, I always get "Debugger stopped. Program exited with status value:0." when clicking on the home button... "UIApplicationExitsOnSuspend" with boolean type, checkbox selected.
swalkner
If you are using the iPhone 4 simulator and you uncheck this box it should "suspend" (if not, try removing the property entirely and/or cleaning all targets and rebuilding). If you're using the iPhone 3.2 simulator, it will always exit as this property is iOS 4 only.
Eric
I just don't get it... my "UIApplicationExitsOnSuspend" is completely ignored... when I ask for "[device respondsToSelector:@selector(isMultitaskingSupported)]" => on Simulator 4.0 it's always true, on 3.2 it's always false. But I really need to be sure that multitasking is turned off... I don't know if I can trust the plist-parameter, when I cant test it without 3GS :(
swalkner
I think that is to be expected; iOS 4 will always respond true, 3.2 false. The behavior on "exit" is what changes based on the property setting. I wish I could help more - for me, setting the UIApplicationExitsOnSuspend property to YES exits the debugger, removing the property does not. The only time it didn't work was when I had a typo - UIApplicationExistsOnSuspend... :)
Eric
can you give me one more hint? did you configure something different than I did - comparing my configuration above? thanks a lot, really...
swalkner
Settings look generally the same, I'm not using libxml, but that won't matter. Changing the Active Executable to "YourApp - iPhone Simulator 4.0" should follow the Info.plist property value. Try doing a "clean all targets" and then compiling+running from scratch. Not sure what else to try.
Eric
A: 

The key UIApplicationExitsOnSuspend works fine only on device iPhone 4. It doesn't work on iPhone 3GS even if you installed iOS4 and have multitasking. That's what our tests show.

A: 

http://www.drobnik.com/touch/2010/07/understanding-ios-4-backgrounding-and-delegate-messaging/

A must read for that problem with a FLowChart what happens when on iOS4

festival