0
如何从MainViewController在AppDelegate中执行一个方法。从ViewController传递数据到AppDelegate
[super performSelector:@selector(doSomething)];
和方法DoSomething的在AppDelegate.m
-(void) doSomething {
NSLog(@"Method Executed");
}
谢谢,但我用这种方法,如果有人发现有帮助 MyExampleAppDelegate * ad = [[MyExampleAppDelegate alloc] [ad doSomething]; [广告发布]; 希望这不会损害应用程序。 –
已更新的答案。 – 2011-07-16 07:53:24