title: force application to terminate in iPhone
body: <p>I am developing an iPhone application which is completely based on web data.</p>
  
  <p>If it is not connected to the internet, the application is of no use.</p>
  
  <p>So, I want to terminate the application when connection is not found. </p>
  
  <pre><code>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" &amp; "close", &amp; when user
          //taps on "close" =&gt; application should terminate.
          // i will send alertview &amp; 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
      }
  </code></pre>
  
  <p>The question is how to terminate the application?</p>
  
  <p>Is <code>exit(0)</code> only the option for terminating application or is there any other option available?</p>