Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

iPhone app development: How to close an application programmatically

Posted on 2009-05-05
3
Medium Priority
?
12,720 Views
Last Modified: 2013-11-25
Hi all,

I need to close an app programmatically and I am doing so with the code attached.

I am getting this warning, however:

"Warning: 'UIApplication' may not respond to '-terminateWithSuccess'
(Messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments.)"

Now, the code works just great, but how can I get rid of these warnings?
[[UIApplication sharedApplication] terminateWithSuccess];

Open in new window

0
Comment
Question by:ehensens
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
chilternPC earned 2000 total points
ID: 24308377
from another post....

Use this to remove the compiler warning:


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


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

Expert Comment

by:chilternPC
ID: 24308407
You can also use

Code:
exit(0);
0
 

Author Comment

by:ehensens
ID: 24308427
The reason I can't use exit(0) is because I have a settings bundle and if I update the settings bundle and exit(0) the new updates don't get saved. But, if I terminateWithSucess, the settings do get saved.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What's a UDID? If you're involved in developing, testing, or even reviewing an iOS application that's in beta, then at some point you may need to know the UDID for any iOS devices that you'll be testing on. What's the UDID? It stands for Unique Dev…
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question