2013-02-23 103 views
-4
[self presentModalViewController:composer animated:YES]; 

在iOS 6中[self presentModalViewController:composer animated:YES];已被棄用

不贊成這樣做什麼,我把這個代替代碼

+0

你應該在的iOS 6使用故事板閱讀:HTTP: //www.raywenderlich.com/5138/beginning-storyboards-in-ios-5-part-1 – kschaeffler 2013-02-23 15:00:47

+1

'[self presentViewController:<#(UIViewController *)#> animated:<#(BOOL)#> completi on:<#^(void)completion#>];' – 2013-02-23 15:02:16

+2

@kschaeffler無需使用故事板。 – Sulthan 2013-02-23 15:13:05

回答

3

看的文檔進行presentModalViewController:animated:。已棄用方法的文檔清楚地說明了您應該使用的地方。

請記住,文檔是你的朋友。 :)

更換是presentViewController:animated:completion:

0
[self presentViewController:vc animated:NO completion:nil]; use this code for `iOS 6` 

iOS SDK,有很的UIViewControllerpresentModalViewController:animated:presentViewController:animated:completion:兩種方法。

在上述兩種說法的主要不同的是,

presentViewController:animated:completion:使用在iOS 5 or lattere.
presentModalViewController:animated:使用較早iOS 5

另請參閱this site for Presenting View Controllers