• 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: Class Extensions (Re: Clueless about this warning)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Class Extensions (Re: Clueless about this warning)


  • Subject: Re: Class Extensions (Re: Clueless about this warning)
  • From: Bill Bumgarner <email@hidden>
  • Date: Sat, 04 Oct 2008 13:43:22 -0700

On Oct 4, 2008, at 12:43 PM, Andrew Merenbach wrote:
On Oct 4, 2008, at 10:32 AM, Bill Bumgarner wrote:
Class extensions are also the one place where you can redeclare that a property is readwrite.

Hi! Â Bill makes a very well-written explanation, but I beg to append (in a very nit-picky fashion) to this point, if only for the sake of the archives. Â If one visits <http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_5_section_3.html >, one sees (under "Property Re-declaration") that:


If you declare a property in one class as readonly, you can redeclare it as readwrite in a class extension (see “Extensions”), a protocol, or a subclass

Correct. Protocols and subclasses enable different behaviors from extensions.


Specifically -- a protocol effectively indicates that your class will implement some set of required or optional methods with the additional benefit of adding a bit of compile time and runtime accessible metadata to the class that says that it conforms to that protocol.

A subclass can override the readonly declaration of a property such that you can create immutable superclass / mutable subclass type relationships akin to various Foundation classes.

b.bum

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >Clueless about this warning (From: Andre Masse <email@hidden>)
 >Re: Clueless about this warning (From: "Jonathan del Strother" <email@hidden>)
 >Class Extensions (Re: Clueless about this warning) (From: Bill Bumgarner <email@hidden>)
 >Re: Class Extensions (Re: Clueless about this warning) (From: Andrew Merenbach <email@hidden>)

  • Prev by Date: Re: NSOutlineView assertion failures
  • Next by Date: Can't bind image cells in a table to file's owner?
  • Previous by thread: Re: Class Extensions (Re: Clueless about this warning)
  • Next by thread: UINavigationItem backButtonTitle property is missing?
  • Index(es):
    • Date
    • Thread