• 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: "Nelson Santos" <email@hidden>
  • Date: Mon, 18 Jun 2007 17:31:45 -0400
  • Importance: Normal

Wagner,

A pointer to a root class would not be as flexible as id since you can
develop your own root classes.  id is nothing more than a "pointer to
anything."  These are two different concepts.

Nelson


-----Original Message-----
From: cocoa-dev-bounces+nelsonsantos=email@hidden
[mailto:cocoa-dev-bounces+nelsonsantos=email@hidden] On Behalf Of
Wagner Truppel
Sent: Monday, June 18, 2007 5:16 PM
To: Shawn Erickson
Cc: email@hidden
Subject: Re: Why the need for the id type?

> 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.

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

_______________________________________________

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

  • Follow-Ups:
    • Re: Why the need for the id type?
      • From: Murat Konar <email@hidden>
References: 
 >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