Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6614751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:22:37+00:00 2026-05-25T20:22:37+00:00

I need to protect my code against possible errors. If they arise then there’s

  • 0

I need to protect my code against possible errors. If they arise then there’s no point to run the app further, so I need to bring to the user some message and then exit the app. So, I’m checking the conditions and then bringing alert:

if (someError){    
  UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"No database file exist. App will close now." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
  [alert show];
  [alert release]; 
}

And in the delegate method I’m closing the app using NSAssert:

-(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
  if (buttonIndex == 0) {
    NSAssert(0, @"closing");
  }
}

Also, I have included delegate protocol in header. However, the app just brings alert but after pressing OK it just freezes, and I’m getting some message “CoreAnimation: ignoring exception: closing”. What am I missing or what other options exits?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:22:37+00:00Added an answer on May 25, 2026 at 8:22 pm

    You should not do that, it is against Apple HIG (Human Interface Guidelines):

    iPhone applications should never quit programmatically because doing so looks like a crash to the user.

    It is always better to provide some kind of feedback to the user about the error that occured and provide a way to restart the process without restarting the app. However, if you really, really want, you can use

    exit(0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need an 1D Convolution against 2 big arrays. I'm using this code in
In my project I need to use third party code, stored in several Git
As part of my project I need to use some Unamanged code dlls in
I need a free code coverage tools in .NET for personal project. NCover is
I need to import some ANSI C code into a project I'm working on.
I have a project in Java and I need to make a code listing
My index.html page for my project needs some Ruby code so I need to
I have found this project on Codeplex. http://www.codeplex.com/ProjNET I need to integrate this code
I am generating a reports using SQL Reporting services 2005. I need to protect
There was a previous question on stackoverflow: Is it possible to start MAIL MERGE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.