2012-01-18 106 views
0

即時通訊新的目標c。 我有這種方法,我希望它從我的故事板加載一個新的視圖,最終。我怎樣才能做到這一點?在方法中加載新的視圖控制器

- (void)stopAnimatingAndLoadView { 
    [self.indicator stopAnimating]; 

    // load new view 
} 

希望你明白我的問題

回答

0

要加載新的看法,我認爲,是一個UIViewController,你已經把它架在故事板。在故事板,如果你給它一個標識符,那麼你可以通過調用加載:

MyOtherViewController *myOtherViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"MyOtherViewController"]; 
// If you are using navigation controller, you can call 
[self.navigationController pushViewController:myOtherViewController animated:YES]; 

// If not, you can present it modally 
[self presentModalViewController:myOtherViewController animated:YES]; 
相關問題