Я прерываю свое приложение iOS следующими способами
-(void)cancelSelected
{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:nil message:@"Are you sure you want to exit?" delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil];
[alert show];
alert = nil;
}
Способ 1:
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex)
abort();
}
Способ 2:
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex)
[NSException raise:@"Disagree terms and conditions." format:@"Quit, Cancel"];
}
Должен ли я сделать это, чтобы выйти из приложения iOS программно?
Приведет ли этот метод abort()
к отклонению моего приложения?
Спасибо!
nil
... таким образом, приложение вылетит и закроется. - person Michal   schedule 30.04.2014