I have developed an iPhone app where there are four tab bar items and if i press the last TabBar the application should terminate. How to do it in Interface Builder?
Asked
Active
Viewed 155 times
0
-
1I vaguely remember the Apple guidelines specifically tell you not to have a quit button. Besides the fact that it's not necessary, if you want to get it approved, don't have one. – Beardo Feb 24 '10 at 16:56
3 Answers
2
Terminating the app must involve code. It can’t be done simply in IB. And there’s no documented and clean way to quit the app besides exit(0)
, see one of the previous questions on this topic.
0
In the action you can write "[[UIApplication sharedApplication] terminateWithSuccess];" And in the head file you add "@interface UIApplication (extended) -(void) terminateWithSuccess; @end"

new soul
- 322
- 1
- 7
-
And then your app will be rejected from the app store for using undocumented API. – Tom Harrington Feb 24 '10 at 17:38