开发者

How to terminate an iPhone application through a TabBaritem in Interface Builder?

开发者 https://www.devze.com 2022-12-21 06:01 出处:网络
I have developed an iPhone app where th开发者_Go百科ere are four tab bar items and if i press the last TabBar the application should terminate. How to do it in Interface Builder?Terminating the app mu

I have developed an iPhone app where th开发者_Go百科ere are four tab bar items and if i press the last TabBar the application should terminate. How to do it in Interface Builder?


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.


In the action you can write "[[UIApplication sharedApplication] terminateWithSuccess];" And in the head file you add "@interface UIApplication (extended) -(void) terminateWithSuccess; @end"


No vagaries.

Never ever quit the app programmatically.

0

精彩评论

暂无评论...
验证码 换一张
取 消