您可以创建一个选择器来完成它...
[myButton addTarget:self action:@selector(mySelector) forControlEvents:UIControlEventTouchUpInside];
你的选择器
- (void)mySelector {
myNewViewController *secondController = [[myNewViewController alloc] init];
[secondController setMyProperty:@"SOME_VAR"];
[self.navigationController pushViewController:secondController animated:YES];
}
在里面secondController.h
@property (nonatomic, strong) NSString *myProperty;
在里面secondController.m
@synthesize myProperty;
在您的第二个(ru2)控制器中-(void)viewDidLoad:
UILabel *lblSecond = [[UILabel alloc] initWithFrame:CGRect(10, 10, 20, 100)];
[lblSecond setText:myProperty];
[self.view addSubview:lblSecond];