2016-05-17 5 views
-1

私は2つのビューコントローラ、TestViewControllerとSecondViewControllerを持っています。 私はTestViewとSecondViewも対応するビューを持っています。Seguesを使用せずに1つのviewControllerから別のviewControllerにデータをプッシュする方法

Seguesを使用せずに、あるView Controllerから別のView Controllerにデータをプッシュする手順を教えてください。

+1

なぜAdi Azarya descibesとしてセグを使用しないのですか? –

答えて

0

Seguesを使用すると、操作が非常に簡単です。あなたはObjective-Cのコード内のメソッドを使用することができます。たとえば :リンクで

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 
{ 
    // Make sure your segue name in storyboard is the same as this line 
    if ([[segue identifier] isEqualToString:@"YOUR_SEGUE_NAME_HERE"]) 
    { 
     // Get reference to the destination view controller 
     YourViewController *vc = [segue destinationViewController]; 

     // Pass any objects to the view controller here, like... 
     [vc setMyObjectHere:object]; 
    } 
} 

をあなたはどのようにすべての説明を持っている上に... :)それが役に立てば幸い。

関連する問題