• 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
What's the point of @properties?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What's the point of @properties?


  • Subject: What's the point of @properties?
  • From: Jim Thomason <email@hidden>
  • Date: Sun, 19 Sep 2010 14:52:46 -0500

I'm refactoring and updating a lot of my older code, and one of the
things I'm finally looking into is declaring things as properties.

But...what's the point? I've been trying to read up on the subject and
have found a lot of posts and discussion about the subject, but very
little of it seems to get down to the meat of what these things are
and why I should care about them.

At the simplest level, I just look at them as some syntactic sugar. So
I get to write one @property line in my @interface and one @synthesize
line in my @implementation (assuming no more complicated behavior, of
course). So it's nifty in that I save myself a lot of redundant
typing, but realistically? I could accomplish the same thing with a
preprocessor macro and have more fine grained control over exactly how
my generated methods look. I mean, it's cool and all that it's built
in and saves me from writing my own macro, but realistically this
isn't terribly interesting.

I know I'd get use of the dot syntax (I do need to use @properties to
do that, right?), but I'm eschewing it anyway. Again, I've seen all
sorts of arguments about people disliking it because it's not
objective-Cish or confusion about structs or whatever, but for me, I
simply just don't care to use it. I've got lots of existing code that
uses methods and I don't see any reason to update. I'm just a stick in
the mud sometimes.

So basically, I get a language built-in version of a macro, and an
option to use a new syntax that I'm not interested in anyway.

Is there something else I'm not seeing or some other utility to them
that I don't yet understand?

-Jim.....
_______________________________________________

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

  • Follow-Ups:
    • Re: What's the point of @properties?
      • From: Uli Kusterer <email@hidden>
    • Re: What's the point of @properties?
      • From: Chris Hanson <email@hidden>
    • Re: What's the point of @properties?
      • From: Ken Thomases <email@hidden>
    • Re: What's the point of @properties?
      • From: Markus Spoettl <email@hidden>
  • Prev by Date: Re: NSSplitView with multiple dividers
  • Next by Date: Re: Linked List
  • Previous by thread: Re: NSSplitView with multiple dividers
  • Next by thread: Re: What's the point of @properties?
  • Index(es):
    • Date
    • Thread