iphone - 解密 UIViewController 属性警告

标签 iphone objective-c warnings

我不明白我在 Xcode 上收到的这个警告是关于什么的。在谷歌上搜索它并没有太大帮助。如果有人以前遇到过此警告,那么如果我能得到一些关于如何摆脱它的提示,那就太好了。

(更新的)屏幕截图位于:

http://imagebin.antiyes.com/images/0116033001255720169_90.png

再次感谢。

编辑: 警告信息,供以后搜索
warning: property 'title' 'copy' attribute does not match super class 'UIViewController' property<br/> warning: property 'title' type does not match super class 'UIViewController' property type

最佳答案

通过在 PageViewController 中命名属性“title”,您实际上是在覆盖 UIViewController 中定义的 title 属性。因此,要么为子类的属性选择一个不同的名称,要么使用 UIViewController 定义的名称。我建议使用第二个,因为看起来您只是想存储 View 的标题。

当您覆盖子类中的属性时,某些属性不能与父类(super class)的定义不同。其中两个是类型和复制与保留与分配(“复制属性”,如警告所述)。由于您在此区域定义的 title 版本与 UIViewController 不同,因此您会收到警告。

关于iphone - 解密 UIViewController 属性警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1579841/

相关文章:

iPhone 推送通知可靠性

iphone - 如何为 itunes 商店构建 xcode 项目?

iphone - 人像年龄渐进算法

iphone - 从 MapView 添加和删除注释会导致眨眼

ios - iOS 11 中如何判断是否录屏

ios - XCode 给我以下 "Apple Mach-O Linker"警告

objective-c - 禁止 UIPickerView 加载 - Obj C

iOS - 当应用程序未运行时 didRecieveRemoteNotification 不起作用

c - 警告 : cast from pointer to integer of different size [-Wpointer-to-int-cast]

c - 当变量被隐藏时得到警告