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: Alex Zavatone <email@hidden>
- Date: Thu, 21 May 2015 09:43:53 -0400
On May 20, 2015, at 7:17 PM, Jens Alfke wrote:
>
>> On May 20, 2015, at 4:08 PM, Eric Wing <email@hidden> wrote:
>>
>> You could use the Objective-C runtime to find out which things are properties.
>
> You could, but isn’t it a lot easier to just look at the character before the name and check whether it’s a “.”?
>
> —Jens
This brings me back to a point of confusion in 2011 where I created properties in a class and accessed them without the self. Or so I thought. Anyway, time for a little research to narrow this down.
On another note, I'm with you on disliking autosynthesis.
What I like about having to manually create the @synthesis is that this creates a nice little table of contents at the top of my .m file. An easy single place where I can see all the props listed within my class. A point of reference.
Putting each property @synthesis on its own line also provides ample room for comments to make everything nice and clear.
Also, you can turn it off autosynthesis? How? That would be a big help for me to straighten out this iOS project where the original developers thought everything needed to be a java bean.
Thanks much.
Alex Zavatone
NSBean - it's what happens when you have Java programmers try to create iOS apps.
_______________________________________________
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