Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?
Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?
- Subject: Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?
- From: Michael David Crawford <email@hidden>
- Date: Wed, 20 May 2015 16:16:42 -0700
You could comment off their declarations in your header files, then
have a look at which uses of them in your sources result in fatal
compiler errors.
(Comment off just one at a time.)
Michael David Crawford, Consulting Software Engineer
email@hidden
http://www.warplife.com/mdc/
Available for Software Development in the Portland, Oregon Metropolitan
Area.
On Wed, May 20, 2015 at 4:08 PM, Eric Wing <email@hidden> wrote:
>> Which are they, ivars or properties?
>>
>> I don't know. I can't tell.
>>
>> Is there any way to inspect an instance and tell if it is a property or an
>> ivar if both the property and ivar have the same name?
>>
>> Fun times, fun times.
>>
>
> You could use the Objective-C runtime to find out which things are properties.
> Look for functions like:
> objc_property_t * class_copyPropertyList ( Class cls, unsigned int *outCount );
>
> ivars that are not properties will not show up as properties, so you
> can cross-reference these with a master list you keep.
>
>
> -Eric
> --
> Beginning iPhone Games Development
> http://playcontrol.net/iphonegamebook/
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden