This is my code:
@interface Object : NSObject {
@private
NSArray *array;
}
@property NSArray *array;
@end
And the @synthesize in the implementation. I get a compiler warning in the line with the @property:
warning: default assign attribute on property ‘array’ which implements NSCopying protocol is not appropriate with -fobjc-gc[-only]
If I write the property as @property (assign) NSArray *array it does not show up. What is this about?
In your case you are creating a property that is a pointer to an object. Assign, which is the default, is not appropriate for objects, which should be declared as
retainorcopy.In your case you should define your property as:
You could use
retaininstead ofcopyhere, but there are good reasons to usecopy.edit
To answer the deeper question you seem to be asking – have a look at this thread from the Cocoa mailing lists.
Are you using the LLVM compiler or gcc?