views:

104

answers:

1

hi guys, im trying to upon recieve a push notification while the app is still running, change view . I tried using this in the AppDelegate.m

-(void)application:(UIApplication *)application didRecieveNotification:(NSDictionary *)userInfo { 
TestClass *aTestClassViewController = [[TestClass alloc]initWithNibName:@"TestClass" bundle:nil];
[self presentModalViewController:aTestClassViewController animated:YES];
[aTestClassViewController release];   }

But it didnt work. i cant even start up the app again. so im guessing this is the wrong way to do it.

Any idea guys? would appreciate it.

A: 

Solved*** I did it this way -> I showed an alert view first (Which i needed anyways) then used the method of

-(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{
    TestClass *aSelectionScreenViewController = [[TestClass alloc] initWithNibName:@"TestClass" bundle:nil];
    [viewController presentModalViewController:aSelectionScreenViewController animated: YES]; 
    [aSelectionScreenViewController release];   }
Kenneth