gpt4 book ai didi

ios - UIActivityIndi​​catorView 与 Storyboard在 Controller 中行为不正确

转载 作者:行者123 更新时间:2023-11-29 04:16:31 25 4
gpt4 key购买 nike

我将 UIActivityIndi​​catorView 放在 Storyboard屏幕上,然后从 Storyboard屏幕将 UIActivityIndi​​catorView 拖到 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 - UIActivityIndi​​catorView 与 Storyboard在 Controller 中行为不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13617906/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com