0

From one UIViewController I call an another UIViewController

FullScreenViewController *anotherViewController = [[FullScreenViewController alloc] initWithNibName:@"FullScreenViewController" bundle:nil];

UIView *theWindow = [currentView superview];

[theWindow addSubview:newView];

On the opened FullScreenViewController, I want to put an UIButton to call a method inside the parent UIViewController.

There's a way to do that? How should I proceed?

Thanks

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370

1 Answers1

0

You could pass a unretained reference to the child view controller during its construction (by passing in self in the parent), which the child could use to call methods on it's parent.

Better still you could make the parent a delegate of the child: How do I create delegates in Objective-C?

Community
  • 1
  • 1
Johnus
  • 722
  • 6
  • 12