作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我将 UIActivityIndicatorView 放在 Storyboard屏幕上,然后从 Storyboard屏幕将 UIActivityIndicatorView 拖到 Controller 的 .h 文件中,并在我的 .h 文件中创建此文件:
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *spinner;
但是当我开始在 .m 文件中工作时,它并没有自动将属性放置在那里,当我尝试将其放置在那里时:
@property (nonatomic, retain) UIActivityIndicatorView *spinner;
这给出了错误
Illigal declaration of property in the continuation class xyz, property must be readWrite...
有人知道为什么会这样吗?我该如何解决它? :)
谢谢!
最佳答案
当您在类延续中重新声明属性时,更改与其关联的内存限定符是非法的,只能从只读变为可读写(反之亦然,尽管我不明白为什么有人会想要去做吧)。要么去掉弱的,要么保留保留的 socket ,只留下一个。
此外,属性不会“自动”为您“放置”在类中。如果您需要访问对象的属性,点或消息语法就可以了。
关于ios - UIActivityIndicatorView 与 Storyboard在 Controller 中行为不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13617906/
我是一名优秀的程序员,十分优秀!