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: Bryan Henry <email@hidden>
- Date: Fri, 11 Jul 2008 22:11:20 -0500
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".
Bryan
On Jul 11, 2008, at 9:51 PM, Quincey Morris wrote:
In Xcode 3.1, recompiling an existing Xcode project with gcc4.2, the
following pattern:
// in Foo.h
@interface Foo {
NSMutableArray* someArray;
}
@property (readonly) NSArray* someArray;
// in Bar.m
... foo.someArray ...
*sometimes* produces the following error message:
type of accessor does not match the type of property someArray
The code, obviously, compiled without error in gcc4.0.
This doesn't happen in every .m file that contains a reference like
'foo.someArray', and it doesn't happen with every property defined
according to this pattern. Changing the type of the property to
NSMutableArray* makes the error message go away. Changing the name
of the instance variable in the header file makes the error message
go away.
Anyone know if there's something genuine being complained about
here, or if there's any way to prevent the error (besides the
unpalatable option of renaming the instance variables)?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@mac.com
This email sent to email@hidden
_______________________________________________
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