storyBoard編程通過performSegueWithIdentifier傳參數

在跳轉  控制器的 類裏面寫此方法

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{    

    if ([segue.identifier isEqualToString:@“toVc"]) {////這裏toVc是拉的那條線的標識符

        

        TheViewController *theVc = segue.destinationViewController;

        theVc.huiModel = pushModel;////傳的參數

        theVc.isLastPushToThisVc = YES;////傳的參數

    }

}

是不是很簡單~


發佈了26 篇原創文章 · 獲贊 48 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章