iPhone: How can a child tell his parent to do something
问题 OK, I have a RootViewController.m and defined a method in there: -(void)doSomethingParent { NSLog(@"Parent is doing something after child has asked"); } I then added a childViewController.view like so: if (self.child == nil) { ChildViewController *cvc = [[ChildViewController alloc] initWithNibName:nil bundle:nil]; self.child = cvc; [cvc release]; } [self.view insertSubview: child.view atIndex:0]; Now, I thought it would be very useful indeed if I could call my doSomethingParent method from