• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: type of accessor does not match the type of property
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >type of accessor does not match the type of property (From: Quincey Morris <email@hidden>)

  • Prev by Date: RE: Jump to Definition problem
  • Next by Date: Re: SenTestingKit/Xcode 3.1 error
  • Previous by thread: type of accessor does not match the type of property
  • Next by thread: Re: type of accessor does not match the type of property
  • Index(es):
    • Date
    • Thread