StoryBoard使用segue页面间传递数据

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
    NSString* data = page1Data.text;
    UIViewController* view = segue.destinationViewController;
    if ([view respondsToSelector:@selector(setParam:)]) {
        [view setValue:data forKey:@"param"];
    }
    
    if ([view respondsToSelector:@selector(setFirstViewController:)]) {
        [view setValue:self forKey:@"firstViewController"];
    }
}

你可能感兴趣的:(StoryBoard使用segue页面间传递数据)