I am new to Objective-C, Cocoa, & iPhone SDK.
This seems to me like it should be very easy to do but I have spent hours trying to find the solution.
I have a RootViewController with a method in it that I want to call from MainView.m. Why isn't this a very simple thing to do? I've searched, read through Objective-C books, begged, nothing works...
RootViewController.m
---------------------------------
-(void) myMethod {
// do something amazingly great
}
MainView.m
----------------------------------
#import "MainView.h"
#import "RootViewController.h"
-(IBAction) myOutlet{
// do some calculations here
// set some variables here
//Now call method inside RootViewController
[RootViewController toggleView];
}
This seems to me like it should be very easy to do but I have spent hours trying to find the solution.
I have a RootViewController with a method in it that I want to call from MainView.m. Why isn't this a very simple thing to do? I've searched, read through Objective-C books, begged, nothing works...
RootViewController.m
---------------------------------
-(void) myMethod {
// do something amazingly great
}
MainView.m
----------------------------------
#import "MainView.h"
#import "RootViewController.h"
-(IBAction) myOutlet{
// do some calculations here
// set some variables here
//Now call method inside RootViewController
[RootViewController toggleView];
}