开发者

How to quit iphone application when complete [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Proper way to exit iPhone application?

There are some similar questions but my question has its own significance.

In my application there are some forms and confirmation button.

When user press confirmation at last form i.e. nib file a message (UIAlertView) is shown saying you have confirmed your order.

Then I want my application to quit. How can i accomplish this?

UPDATE:

In my application i have confirmation form.

When somebody click confirm button i have shown UI Alert button saying your order is confirmed.

Because i cant exit application (Apple does not recommend that) i want to show it another view i.e. nib file having label telling user to press home button.

But i have UI Alert view as well which tells success and failure of confirmation dis开发者_如何学JAVApatch to database.

So how can i accomplish whole process?


You can use the c function call abort() to accomplish this.

I strongly suggest that you reread the HIG though, especially if you're planning to release this to the public.

You can find it here.


You cannot do that. Self-terminating apps violate Apple's guidelines. See here.


Simple answer: You should not. There is no correct way to do this and apple wont allow such an app on the appstore.

If you had to and wanted to publish the app in Cydia or only use it for your self, you could call an undefined method, which would crash the app.

'[self undefinedMethodName];'

Or call 'exit(0);'

Dont do it.


You should not do that. Apple advises that whenever your app must terminate, you should prompt the user to press the home button. If you feel like you want to ignore the rules, use abort().

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜