I think you should use NSNotificationCenter for this
in AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... ... [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(buttonPushed:) name:@"ButtonPushedNotification" object:nil]; } - (void)applicationWillTerminate:(UIApplication *)application { ... ... [[NSNotificationCenter defaultCenter] removeObserver:self]; }
this is the selector that will be called when a notification appears (we are still in AppDelegate.m )
- (void)buttonPushed:(NSNotification *)notification { NSLog(@"the button pushed..."); }
and in ViewController.m , when the button is pressed (inside the method), you should send a notification as follows:
{ ... [[NSNotificationCenter defaultCenter] postNotificationName:@"ButtonPushedNotification" object:nil]; ... }
holex source share