Reputation: 2425
Hopefully a simple question, but I don't have an iOS3 / device multitasking is not supported on.
My app is now set to run in the background (plays audio), I have an animation that runs and I terminate that through applicationDidEnterBackground.
I want my app to exit if multitasking is not supported. I have code in place to detect multitasking capabilities:
UIDevice* device = [UIDevice currentDevice];
BOOL backgroundSupported = NO;
if ([device respondsToSelector:@selector(isMultitaskingSupported)])
backgroundSupported = device.multitaskingSupported;
if (backgroundSupported == NO) {
NSLog(@"Multitasking not supported");
}
else
{
NSLog(@"Multitasking supported");
}
My question is.... how can I kill the app from inside the else statement above?
Thanks
Upvotes: 0
Views: 249
Reputation: 23359
The following would work: exit(0)
This is also possible, [[NSThread mainThread] exit], and this is probably a nicer way to do so, stay with Objective-C if you can my friend.
Upvotes: 2