Re: Private ivars, not marked as IBOutlet, visible in IB
Re: Private ivars, not marked as IBOutlet, visible in IB
- Subject: Re: Private ivars, not marked as IBOutlet, visible in IB
- From: David Duncan <email@hidden>
- Date: Mon, 15 Mar 2010 15:59:58 -0700
On Mar 15, 2010, at 3:49 PM, Jeff Laing wrote:
> But my protocol only wanted to define the methods in my protocol - a nice clean Interface definition that's independent of all other definitions. After all, Apple might add some non-optional methods to NSObject (ok, that's unlikely) that all objects implementing my protocol would suddenly fail to compile on.
Unless you are going to be working with objects that don't descend from NSObject (the class) then extending NSObject (the protocol) should not be an issue. From the documentation on the NSObject Protocol:
"The NSObject protocol groups methods that are fundamental to all Objective-C objects.
If an object conforms to this protocol, it can be considered a first-class object. Such an object can be asked about its:
• Class, and the place of its class in the inheritance hierarchy
• Conformance to protocols
• Ability to respond to a particular message
In addition, objects that conform to this protocol—with its retain, release, and autorelease methods—can also integrate with the object management and deallocation scheme defined in Foundation (for more information see, for example, Memory Management Programming Guide for Cocoa). Thus, an object that conforms to the NSObject protocol can be managed by container objects like those defined by NSArray and NSDictionary.
The Cocoa root class, NSObject, adopts this protocol, so all objects inheriting from NSObject have the features described by this protocol."
On a practical note, many of the protocols that you work with in Cocoa and Cocoa Touch also declare that they extend NSObject, so this assumption has already been made for you in many places.
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
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: | |
| >Re: Private ivars, not marked as IBOutlet, visible in IB (From: Lynn Barton <email@hidden>) |
| >Re: Private ivars, not marked as IBOutlet, visible in IB (From: Joanna Carter <email@hidden>) |
| >Re: Private ivars, not marked as IBOutlet, visible in IB (From: Thomas Engelmeier <email@hidden>) |
| >Re: Private ivars, not marked as IBOutlet, visible in IB (From: Joanna Carter <email@hidden>) |
| >Re: Private ivars, not marked as IBOutlet, visible in IB (From: Alexander Spohr <email@hidden>) |
| >Re: Private ivars, not marked as IBOutlet, visible in IB (From: Roland King <email@hidden>) |
| >Re: Private ivars, not marked as IBOutlet, visible in IB (From: Joanna Carter <email@hidden>) |
| >Re: Private ivars, not marked as IBOutlet, visible in IB (From: Alexander Spohr <email@hidden>) |
| >Re: Private ivars, not marked as IBOutlet, visible in IB (From: Kevin Cathey <email@hidden>) |
| >RE: Private ivars, not marked as IBOutlet, visible in IB (From: Jeff Laing <email@hidden>) |
| >Re: Private ivars, not marked as IBOutlet, visible in IB (From: David Duncan <email@hidden>) |
| >RE: Private ivars, not marked as IBOutlet, visible in IB (From: Jeff Laing <email@hidden>) |