Set the text of the second label from the action method of the first button?
View1Controller *m_poView1Controller;
View2Controller *m_poView2Controller;
#import <UIKit/UIKit.h>
#import "YourAppDelegate.h"
@class YourAppDelegate;
@interface View1Controller : UIViewController
{
YourAppDelegate *m_poAppDelegate;
.......
}
- (IBAction)buttonDoSomethingPressed:(id)sender
{
self.m_poAppDelegate = [[UIApplication sharedApplication] delegate];
// change view of View2Controller
[[[self.m_poAppDelegate m_poSwitchViewController] m_poView2Controller] somefunc:somevars];
}
WelcomePage *welcomePage;//The second view controller
TestAppDelegate *m_poAppDelegate;
[[[self.m_poAppDelegate m_poSwitchViewController] welcomePage]change_Text];
In the header (interface) for TestAppDelegate, and implement it in the implementation file.
WelcomePage *welcomePage;//The second view controller
TestAppDelegate *m_poAppDelegate;
[[[self.m_poAppDelegate m_poSwitchViewController] welcomePage]change_Text];
I did everything but what type the "m_poSwitchViewController" should be?
ViewController1 type or ViewController2 type?
ViewController1 *m_poSwitchViewController;
ViewController2 *m_poSwitchViewController;
?
SwitchViewController *m_poSwitchViewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[window addSubview:m_poSwitchViewController.view];
[self.window makeKeyAndVisible];
//
// create the queue to run our SubmitAnswerOperation
//
self.m_poQueue = [[NSOperationQueue alloc] init];
return YES;
}