Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RossOliver

macrumors regular
Original poster
Nov 6, 2006
157
0
Hey,

Is there a way to kill the application (so the applicationWillTerminate is called) without the user pressing their home button?

Thanks,

-Ross
 

RossOliver

macrumors regular
Original poster
Nov 6, 2006
157
0
See my thread here. I'm pretty sure the delegate methods get called...

The delegate methods do get called, but I'm not so keen on the compiler warning... I may try a different approach that just blocks the user by way of disabling interface components so all they can do is hit the home button...

Cheers,

-Ross
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Use this to remove the compiler warning:

Code:
	[[UIApplication sharedApplication] performSelector:@selector(terminateWithSuccess)];

Of course if Apple change this private API this will stop working.
 

RossOliver

macrumors regular
Original poster
Nov 6, 2006
157
0
Use this to remove the compiler warning:

Code:
	[[UIApplication sharedApplication] performSelector:@selector(terminateWithSuccess)];

Of course if Apple change this private API this will stop working.

Thanks for the tip - but as you say, apple may update the API and wreck this workaround... I think it will be best if I find a more standard way...
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
I looked into this for a while a few days ago. AFAIK, terminate and terminateWithSuccess (both private methods BTW) don't do the spiffy animation when you quit. They just close your app immediately. I think that animation is a system animation and can't be used by your app. I hacked around the simulator files with class-dump and nm but didn't find anything.

One alternative I tried was displaying an alert view repeatedly telling the user to quit the app. But I settled on just transitioning the app to a different view (my app has a startup view) that the user can't use the app from.

So I would rethink what exactly you're trying to do.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.