很多功能都被弃用了 - iOs 6

时间:2012-09-20 06:58:52

标签: objective-c ios deprecated ios6

我有一些自iOs 6以来被弃用的功能。 也许这对那些刚刚更新到iOs 6的人也会有所帮助。

    [self presentModalViewController:pNewController animated:YES];
 presentModalViewController:animated is deprecated since iOs 6

 Autosynthesized property 'String' will use synthesized instance variable '_String', not existing instance variable 'String'

Autosynthesized property 'phonenumber' will use synthesized instance variable '_phonenumber', not existing instance variable 'phonenumber'


 Deprecated: Group Table View Background Color is deprecated in iOS 6.0.

任何人都可以帮我修复它,这样我的项目就不会有任何已弃用的功能。

先谢谢

5 个答案:

答案 0 :(得分:140)

[self presentModalViewController:pNewController animated:YES];

可以替换为

[self presentViewController:pNewController animated:YES completion:nil];

这一变化的背景可以在WWDC 2012视频会议#236上看到,这是iOS视图控制器的发展。

答案 1 :(得分:9)

点击不推荐使用的方法。在右侧列Quick Help inspector中,您可以看到Apple文档的快速帮助 还建议使用更新或替代方法。

答案 2 :(得分:2)

试试这个,

以“源代码”模式打开.storyboard文件或.xib文件。

查找并删除此行:

<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>

答案 3 :(得分:1)

我可以帮助你完成最后一个:这意味着ios6中不再支持颜色GroupTableViewBackgroundColor。您可能在某处的xib文件中使用过它。

答案 4 :(得分:1)

像这样使用

[self presentViewController:object animated:YES completion:NULL];

[object dismissViewControllerAnimated:YES completion:NULL];
相关问题