• 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: mmalc Crawford <email@hidden>
  • Date: Mon, 18 Jun 2007 14:25:53 -0700


On Jun 18, 2007, at 2:12 PM, Wagner Truppel wrote:
Yes, I've read that before.

You didn't say so earlier...

Now, note this sentence:
"The id data type makes it possible to substitute any type of object at runtime."
The same would be true of some actual root class, be it NSObject or some other, as in java's Object.


Read the rest of the paragraph...

Did you try compiling any test cases such as:


NSObject *myObject; NSObject *anotherObject;

[myObject addObject:anotherObject];


and

id myObject;
id anotherObject;

[myObject addObject:anotherObject];


Just as the subsequent sentences in that paragraph elaborate, this illustrates the difference between static and dynamic type checking at compile time.


mmalc

_______________________________________________

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: mmalc Crawford <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