• 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 isn't id<MyCellDelegate> an id?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why isn't id<MyCellDelegate> an id?


  • Subject: Re: why isn't id<MyCellDelegate> an id?
  • From: Greg Parker <email@hidden>
  • Date: Fri, 04 Oct 2013 12:50:03 -0700

On Oct 4, 2013, at 9:59 AM, Matt Neuburg <email@hidden> wrote:
> Surely an id<MyCellDelegate> is, by definition, an id

It is not. There is no id-style type system leniency in `id<SomeProtocol>`. That type must conform to the protocol and respond to its methods, and nothing more. Unlike `id` it does not allow use of any other methods.

In practice you'll usually want to use NSObject<SomeProtocol>*, in part because there are useful methods in class NSObject that are not part of protocol NSObject.


--
Greg Parker     email@hidden     Runtime Wrangler



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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 isn't id<MyCellDelegate> an id?
      • From: Matt Neuburg <email@hidden>
References: 
 >why isn't id<MyCellDelegate> an id? (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: How to get a "Normal" button in iOS 7/IB
  • Next by Date: Autolayout fixed size centering in VFL
  • Previous by thread: Re: why isn't id<MyCellDelegate> an id?
  • Next by thread: Re: why isn't id<MyCellDelegate> an id?
  • Index(es):
    • Date
    • Thread