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 the child. So I thought I would do it like this:
@implementation ChildViewController
@class RootViewController;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[super doSomethingParent];
}
But xCode tells me that "-doSomethingParent" not found... but I put @class in there?! Shouldn't it find it? I don't want to import the whole thing as I thought @class would be sufficient to let the child know that the parent has a method called doSomethingParent...
I'd be very grateful for any suggestions. Thanks in advance!