• 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: Why the need for the id type?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why the need for the id type?


  • Subject: Re: Why the need for the id type?
  • From: "Shawn Erickson" <email@hidden>
  • Date: Mon, 18 Jun 2007 14:25:21 -0700

On 6/18/07, Wagner Truppel <email@hidden> wrote:
> On 6/18/07, 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?
>
> NSObject is a Cocoa framework concept. Objective-C is not bound to
> Cocoa.

Fair enough. The point remains, though. To me, id is nothing more
than a root class, much like Object in java. Is that true, or is
there something else to it that I'm missing?

> Additionally even within Cocoa not all objects inherit from NSObject
> (some just conform to the NSObject protocol).

True. Again, they're id, so it's as if they inherit from a master
root class.

I apologize for belaboring the point. It's just that I still don't
see a difference between id and a root class.

id isn't a class it is a type that means any class. I am not sure what more can be said about it...

-Shawn
_______________________________________________

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


References: 
 >Why the need for the id type? (From: Wagner Truppel <email@hidden>)
 >Re: Why the need for the id type? (From: "Shawn Erickson" <email@hidden>)
 >Re: Why the need for the id type? (From: Wagner Truppel <email@hidden>)

  • Prev by Date: Re: Why the need for the id type?
  • Next by Date: Re: Why the need for the id type?
  • Previous by thread: Re: Why the need for the id type?
  • Next by thread: Re: Why the need for the id type?
  • Index(es):
    • Date
    • Thread