Я занимаюсь разработкой приложения для 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)
только опцией для завершения приложения или есть какая-либо другая опция?