我有一个名为responseReference的NSString,我将其放入@property中,如下所示...
@property (nonatomic) NSString *responseReference;
我收到了警告:
No 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed
Assign attribute (default) not appropriate for non-gc object property 'responseReference'
所以为了简单地修复它,我将代码更改为:
@property (nonatomic, retain) NSString *responseReference;
但我仍然收到警告。我尝试了很多方法,最终试图通过删除该对象来消除警告。但即使当responseReference不再是我的任何代码的一部分时,它仍然给了我完全相同的responseReference警告。所以我重新启动了X-Code。没有豆子。
谁能解释为什么它给我这些警告,即使它所谈论的对象不存在?另外,这些警告是否意味着我编译的代码受到影响?
I had an NSString named responseReference that I put in a @property like so...
@property (nonatomic) NSString *responseReference;
and I got the warning:
No 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed
Assign attribute (default) not appropriate for non-gc object property 'responseReference'
So to simply fix it I changed the code to this:
@property (nonatomic, retain) NSString *responseReference;
but I still got the warnings. I tried many things and ended up trying to remove the warnings by just removing the object from existence. But even when responseReference was no longer a part of ANY of my code it still gave me the exact same warning for responseReference. So I restarted X-Code. No beans.
Can anyone explain why it's giving me these warnings even though the object it's talking about doesn't exist? Also, do these warnings mean that my compiled code is affected?
发布评论