2013-02-23 60 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