许多功能已被弃用 - iOs 6
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12507455/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
A Lot of Functions are deprecated - iOs 6
提问by David Raijmakers
I have a few functions that are deprecated since iOs 6. Maybe this'll be helpful for others who also just updated to iOs 6.
我有一些自 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.
Could anyone help me how to fixed it so there wont be any deprecated functions in my project.
任何人都可以帮助我如何修复它,以便我的项目中不会有任何弃用的功能。
Thanks in Advance
提前致谢
回答by masam
[self presentModalViewController:pNewController animated:YES];
can be replaced by
可以替换为
[self presentViewController:pNewController animated:YES completion:nil];
The background of this change can be seen on WWDC 2012 video session #236, the evolution of view controllers on iOS.
这种变化的背景可以在 WWDC 2012 视频会议 #236 上看到,iOS 上的视图控制器的演变。
回答by brush51
click on the method which is deprecated. in the right column Quick Help inspector
you can see the Quick Help from the Apple docs.
There is also a recommandation to use updated or alternate methods.
单击已弃用的方法。在右栏中,Quick Help inspector
您可以看到 Apple 文档中的快速帮助。
还有使用更新的或替换的方法建议:。
回答by tricycle
Try this,
尝试这个,
Open the .storyboard file or .xib file in "Source Code" mode.
在“源代码”模式下打开 .storyboard 文件或 .xib 文件。
Find and remove this line:
查找并删除此行:
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
回答by Kirit Vaghela
Use like this
像这样使用
[self presentViewController:object animated:YES completion:NULL];
[object dismissViewControllerAnimated:YES completion:NULL];
回答by Vincent Osinga
I can help you with the last one: it means that the color GroupTableViewBackgroundColor is no longer supported in ios6. You probably used this in your xib files somewhere.
我可以帮你解决最后一个:这意味着在 ios6 中不再支持颜色 GroupTableViewBackgroundColor。您可能在某处的 xib 文件中使用了它。