Я пытаюсь создать alertView из appDelegate, но не могу заставить его работать. alertView будет действовать как заявление об отказе от ответственности при первом запуске приложения. Я не могу заставить его работать.. introViewcontroller не появляется. Что я делаю не так? пс. Я использую раскадровки, за исключением intoViewController, который представляет собой файл nib. Мой корневой контроллер представления — это «fisrtViewController», вот мой код: Спасибо..
int a;
и в didFinishLaunchingWithOptions
if ( a == 0) {
UIAlertView *disclaimer = [[UIAlertView alloc] initWithTitle:@"Read Before use" message:@"By using this app you agree to its terms and conditions.\n\n\n\n\n\n\n\n\n\n\ntext heren\n\n\n\n\n\n\n\n\n\n\n\n\n" delegate:self cancelButtonTitle:@"No!" otherButtonTitles:@"Yes Let me In", nil];
[disclaimer show];
}
// Override point for customization after application launch.
return YES;
}
-(void) alertView:(UIAlertView *) alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 1) {
// FirstViewController *firstView = [[FirstViewController alloc] init];
a+=1;
// [self.viewController presentModalViewController:firstView animated:YES];
}
else if (buttonIndex == 2) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Sorry!" message:@"You are not allowed to use this app due to the fact that you did not agree to the terms and Conditions. Please exit this app!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
if (buttonIndex ==1) {
introViewController *intro = [[introViewController alloc] initWithNibName:@"introViewController" bundle:nil];
[self.viewController presentModalViewController:intro animated:YES];
introViewController *intro = [[introViewController alloc] initWithNibName:@"introViewController" bundle:nil];
[self.viewController presentModalViewController:intro animated:YES];
}
}