웹 데이터를 기반으로하는 iPhone 응용 프로그램을 개발 중입니다.iPhone에서 강제 종료 응용 프로그램
인터넷에 연결되어 있지 않으면 응용 프로그램을 사용할 수 없습니다.
그래서 연결을 찾을 수 없을 때 응용 프로그램을 종료하고 싶습니다.
NSURL *tmpURl=[NSURL URLWithString:[NSString stringWithFormat:@"%@search.php",[iGolfAppDelegate getServerPath]]];
NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:tmpURl];
con=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if(con){
myWebData=[[NSMutableData data] retain];
} else {
//Yes I will provide two buttons on alertview "retry" & "close", & when user
//taps on "close" => application should terminate.
// i will send alertview & when user taps on button close then
// what to write for terminating application?
// Ok Ok. Don't terminate. User will terminate.
// user is owner of iPhone
// let him choose what to do
// wait till wifi connects
}
질문은 어떻게 응용 프로그램을 종료합니까?
exit(0)
은 응용 프로그램 종료 옵션입니까 아니면 다른 옵션이 있습니까?
http://stackoverflow.com/questions/355168/properway-to-exit-iphone-application (허용되는 대답은 "잘못"임에도 불구하고)을 참조하십시오. –
그러면 답은 무엇이되어야합니까? –
정답은 "하지 마세요"입니다. 게시 된 UI 지침에 위배됩니다. 몇 명의 의견 작성자가 대신 할 일을 제안했습니다. –