Re: type of accessor does not match the type of property
Re: type of accessor does not match the type of property
- Subject: Re: type of accessor does not match the type of property
- From: Quincey Morris <email@hidden>
- Date: Fri, 11 Jul 2008 20:28:38 -0700
On Jul 11, 2008, at 19:58, Bryan Henry wrote:
You seem to have already found the solution. Why is your property
type different from the instance variable type? It should be
"@property(readonly) NSMutableArray* ivarName;" for an ivar of type
NSMutableArray, not "@property(readonly) NSArray *ivarName".
Property != instance variable. The type of the instance variable (if
any) providing storage for a property is an implementation detail. I
can't imagine any reason why the compiler would connect the two names
based on the information in the header file. There is also no error in
Foo.m, which would be the right place to complain if there really was
something wrong.
Incidentally, the reason why the types are different is to prevent
users of the property from modifying it in a non-KVO-compliant way.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden