• 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: Chris Williams <email@hidden>
  • Date: Mon, 18 Jun 2007 14:57:30 -0700
  • Thread-topic: Why the need for the id type?

On 6/18/07 2:28 PM, "Greg Titus" <email@hidden> wrote:

> In this code:
>
> id foo;
> [foo someRandomMethod];
>
> As long as -someRandomMethod exists _anywhere_ on any class, it will
> work. Importantly, -someRandomMethod can be implemented on many
> classes which DO NOT share any common root class, and the code will
> work.

Important distinction -- it will COMPILE.  I may NOT work.  In fact, it
could fail in a very ugly fashion at runtime if in fact foo is not an object
with -someRandomMethod by that point.

_______________________________________________

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: Oleg Kibirev <email@hidden>
    • Re: Why the need for the id type?
      • From: Dave Camp <email@hidden>
References: 
 >Re: Why the need for the id type? (From: Greg Titus <email@hidden>)

  • Prev by Date: Ligatures with appendBezierPathWithGlyph
  • Next by Date: Re: Ligatures with appendBezierPathWithGlyph
  • 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