How to quit an iPhone app nicely?

早过忘川 提交于 2020-01-10 03:15:07
问题 or "How to simulate a home button pressed event?" I need to restart my iPhone app, and I want the program to quit, so the user will only have to start it. If I simply use exit(0) some changes won't get saved, as they would if the user quits by pressing the home button. The restart needed for language change. Related code: - (void)onChangeLanguage: (id)sender { NSArray *lang = [NSArray arrayWithObjects:((Whatever *)sender).newLanguage, nil]; [[NSUserDefaults standardUserDefaults] setObject

IOS Simulator cannot find sdk and the simulated application quit errors

久未见 提交于 2020-01-01 01:56:07
问题 I have been having this Xcode problem for a couple of months where my iOS simulator stops working whenever i run any application on Xcode and says, "The simulated application quit." and "iOS Simulator could not find the SDK. The SDK may need to be reinstalled." I am running Xcode 4.3.3 and have iOS sdk 5.1 and everything updated but it happened on my previous version of Xcode also. I have tried reinstalling Xcode over 10 times now and have been posting this question for a while now. No one

No Application Quit event in Outlook?

一世执手 提交于 2019-12-30 09:05:33
问题 I'm using the 12.0 Interop library, which is the default for Outlook 2007. I'm actually aiming for Outlook 2003 to 2010 integration with a code example that registers to a quit event. Even though the docs say that there is an application Quit event for the Outlook app, I can't find it in the Outlook.Application object implementation. Visual Studio 2010 seems to identify Quit as a method: Question: How would one register to the Outlook application's Quit event? (if there is one, or any event

How to enter 'quit' to close progrom

最后都变了- 提交于 2019-12-26 08:52:43
问题 I need help with closing the program by entering 'quit' for example. while(true) { cout << "enter a name" << endl; std::getline (std::cin,input); if(input =='quit') { break; } } it is not breaking out or quiting, also how come you can't compare a string to a int? i.e. : while (input != 'quit') <<-- that won't work also. 回答1: quit needs to be in double quotes to be a string : #include <iostream> int main() { std::string input; while (true) { std::cout << "enter a name: "; std::getline(std::cin

C# WebPages : manage Exit events or quit with no user action server side

最后都变了- 提交于 2019-12-24 19:07:13
问题 What is the better solution to manage Exit or Quit events when user exit to other pages with no action?. This event need to be raised only one time and be usefull to delete all temporary files or datas not stored after the abandon of this page. Is a perfect to use as cleaning method server side. Thanks. 回答1: The web is stateless so there shouldn't really be anything to clean up. However, sometimes you may want to kill the session when the user tries to close browser. I guess you could catch

Phonegap: force an app to quit instead of running in background

北城余情 提交于 2019-12-22 11:00:15
问题 I'm developing an iPhone/iPad application through Phonegap, is there a way to implement a sort of "click here to quit app"? I mean quit for real, not "put it in the background and go to home screen". Thanks in advance. 回答1: you can use following code to quite your app on click, device.exitApp() OR navigator.app.exitApp() Hope this may help you. 回答2: is there a way to implement a sort of "click here to quit app"?' Yes, there is a way for really exiting the app and killing its process. But

Best way to quit android app?

删除回忆录丶 提交于 2019-12-19 03:49:23
问题 I'm looking for a way to quit my android app by code. Yes, I know, I shouldn't be doing this cause android handles it when you press the back button, but I have a customized flow that forces me to implement this. I've already been searching for a while, and found multiple answers: It shouldn't be done => No option. Call finish() in my activity => Only for 1 activity, not the whole app. Start an Intent to the first activity with a special flag => I have multiple entrypoints, so not really an

openssl hangs and does not exit

不羁的心 提交于 2019-12-18 10:56:06
问题 I am trying to use openssl to get a certificate, and it seems to keep hanging. I have done a lot of research but not all of the available options seem to work on Windows. openssl s_client -showcerts -connect google.com:443 > cert.txt I have tried this: openssl s_client -connect xyz:443 < quit.txt > cert.txt Where quit.txt contains "quit\n" from http://bytes.com/topic/php/answers/8802-automate-openssl-s_client-command-batch-php-script That did not work. I also looked at Openssl s_clinet

does dealloc method being executed normally when quitting the application?

我的梦境 提交于 2019-12-17 20:51:55
问题 I use code like the following (inside my appController.m for example) to do some cleanup when my application terminates... - (void) dealloc { [myObject release]; // myObject 's dealloc will not be called either !!! [arraySMSs release]; [super dealloc]; } This method never get called when the app quits! Why ? Is there a better place to do my clean up ? The fact that is not called addresses memory-leak issues ? Or the OS does take care of clean up ? Thank you... 回答1: There is no reason for the

What is the correct way to programmatically quit an MFC application?

一个人想着一个人 提交于 2019-12-17 19:12:41
问题 Using windows MFC C++. I have a third party app that calls a user-defined method in my CWinApp derived class. This method is called after InitInstance(). If there is an error in this method, such that an exception is thrown and caught in a try/catch block, I would like to exit the application from the catch block. What is the canonical and correct way to quit? UPDATE: Serge I believe is right that in InitInstance() returning false is the correct way to quit the application. However, now