ios不同View间传参方法

不同View间传参方法,互相调用即可,通过内部函数和指针传递。

@interface wordpress_otpViewController {}
-(void)setViewConfig:(NSString *)str;
end

@interface configViewController{
@public
wordpress_otpViewController * m_wpViewController;
}

-(void)setConfig:(NSString *)str;
end

======================
wordpress_otpViewController中调用:
configViewController * mconfigViewController = [[configViewController alloc] initWithNibName:@"configViewController" bundle:[NSBundle mainBundle]];

mconfigViewController->m_wpViewController = self;

[mconfigViewController setConfig:@"test"];

[self.navigationController pushViewController:mconfigViewController animated:YES];

[mconfigViewController release];

=========================
configViewController 子view调用:
[m_wpViewController setViewConfig:@"set"];

 
| 0个评论