Re: Why the need for the id type?
Re: Why the need for the id type?
- Subject: Re: Why the need for the id type?
- From: j o a r <email@hidden>
- Date: Tue, 19 Jun 2007 21:34:25 +0200
On 19 jun 2007, at 20.40, Bill Bumgarner wrote:
* it is a means of indicating that you do, in fact, not care one
little bit what type of an object the id refers to.
And in addition, you can do neat things like this:
- (void) foo:(id <Bar>) bar;
Where you in a nice and clean OOP way indicate that you care only
about the set of methods that "bar" responds to, and nothing for what
class hierarchy it belongs to. Though, I guess we could just as well
have solved that by allowing something like this instead:
- (void) foo:(<Bar>) bar;
Also note that most of the times when we use (id), we actually mean
(id <NSObject>). The reason that it works is of course that we
effectively have a single root class in Cocoa.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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