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: Charles Steinman <email@hidden>
- Date: Mon, 18 Jun 2007 14:22:10 -0700 (PDT)
If you declared it as a specific class, any message
said class does not respond to would trigger a
warning. Can you imagine the fun if NSView's
initializer returned something type-checked as
NSObject?
Cheers,
Chuck
--- Wagner Truppel <email@hidden> wrote:
> 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
>
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
_______________________________________________
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