Why the need for the id type?
Why the need for the id type?
- Subject: Why the need for the id type?
- From: Wagner Truppel <email@hidden>
- Date: Mon, 18 Jun 2007 22:46:12 +0200
Hi everyone,
I apologize if this isn't directly related to Cocoa, but I suddenly
realized that I don't understand why id should be necessary. Why
isn't NSObject (or some other root class) enough? In java, for
instance, all objects inherit from Object. In a very real sense, as
far as I can see, that is essentially equivalent to full dynamic
typing. And, sure enough, you have dynamic binding, polymorphism, and
introspection (though it's somewhat annoying to work with it in java).
I don't remember when or where from, but I once heard it said that
Cocoa couldn't be completely done in java. I don't see why not. In
any case, that's not the main reason for my question. My question is
really about understanding what is so important or different about id
that makes it necessary.
Oh, and, yes, I have read Apple's pdf on Objective-C. :)
Thank you in advance.
Wagner
_______________________________________________
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