用属性进行传值,将A界面的值传递到B界面。在B类中定义一个变量,然后在A类中跳转到B类中的地方,对需要传递的变量进行赋值。
在A界面中代码
#import "AViewController.h"
#import "BViewController.h"
@interface AViewController ()
@property (retain, nonatomic)UITextField *textField;
@end
@implementation AViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
self.title = @"属性正向传值";
_textField = [[UITextField alloc] initWithFrame:CGRectMake(10,