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

  • Prev by Date: Re: SenTestingKit/Xcode 3.1 error
  • Next by Date: Re: Xcode 3.1 is available at connect.apple.com (Part 2b)
  • Previous by thread: Re: type of accessor does not match the type of property
  • Next by thread: C++ debug problem with gcc 4.2 installed by Xcode 3.1
  • Index(es):
    • Date
    • Thread