属性传值

AddFriendViewController.h

@property(nonatomic,copy)NSString* passedString;

RootViewController.m

-(void)didClickedRightBarButtonItem:(UIBarButtonItem*)button{

NSLog(@"你好");

//点击推出新的界面:

AddFriendViewController* addVC= [[AddFriendViewControlleralloc]init];

//属性传值!!

addVC.passedString=@"张三";

[self.navigationControllerpushViewController:addVCanimated:YES];

[addVCrelease];

}

你可能感兴趣的:(属性传值)