我想通过警报视图从 AppDelegate 推送到视图控制器。但它不起作用。只有警报视图会消失。哪里有问题?在此先感谢您的帮助。(注意 > 我的初始视图在情节提要中,但我正在推入视图控制器笔尖)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
loginReapeat = [NSTimer scheduledTimerWithTimeInterval:60.0 target:self selector:@selector(repeatLoginProcess) userInfo:nil repeats:YES];
//First Launch Settings
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"FirstLaunch"])
{
}
else
{
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"FirstLaunch"];
[[NSUserDefaults standardUserDefaults] synchronize];
[self alertShow];
}
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
return YES;
}
-(void)alertShow{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Help!" message:@"Need some help to use this App? Please tap the 'Help' button." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Help",nil];
[alert show];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
NSString *title = [alertView buttonTitleAtIndex:buttonIndex];
if([title isEqualToString:@"Help"])
{
SignUp *signUp = [[SignUp alloc]initWithNibName:@"SignUp" bundle:nil];
[self.navigationController pushViewController:signUp animated:YES];
}
}