0

I put a UIActivityIndicatorView on my storyboard screen and from the storyboard screen I dragged the UIActivityIndicatorView to the .h file of my controller and it created this in my .h file:

@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *spinner;

But when I started working in the .m file, it didn't place the property there automatically, and when I tried to put this in there:

@property (nonatomic, retain) UIActivityIndicatorView *spinner;

which gave the error

Illigal declaration of property in the continuation class xyz, property must be readWrite...

Does anyone know why this is happening? And how do I fix it? :)

Thanks!

4

1 回答 1

1

当您在类延续中重新声明一个属性时,更改与其关联的内存限定符是非法的,只能从只读变为读写(反之亦然,尽管我不明白为什么有人想要这样做)。要么移除弱点,要么移除保留的出口,只留下一个。

此外,属性不会“自动”为您“放置”在类中。如果您需要访问对象的属性,点或消息语法就可以正常工作。

于 2012-11-29T02:40:36.147 回答