• 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: Implementing delegates with formal protocols
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implementing delegates with formal protocols


  • Subject: Re: Implementing delegates with formal protocols
  • From: Rick Mann <email@hidden>
  • Date: Fri, 28 Aug 2009 15:06:33 -0700


On Aug 28, 2009, at 15:02:13, Corbin Dunn wrote:


On Aug 28, 2009, at 2:57 PM, Rick Mann wrote:

Thanks for the suggestions. I have one suggestion saying to extend my protocol to conform to NSObject, and another saying I should use NSObject instead of ID.

Is one approach better than the other?

Yes; David's suggestion is preferred. It is what we did in AppKit for SnowLeopard, ie:


@protocol NSControlTextEditingDelegate <NSObject>

The main reason is so controls can store a reference and do a - respondsToSelector: on @optional methods.

Thanks much!


_______________________________________________

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


References: 
 >Implementing delegates with formal protocols (From: Rick Mann <email@hidden>)
 >Re: Implementing delegates with formal protocols (From: David Duncan <email@hidden>)
 >Re: Implementing delegates with formal protocols (From: Rick Mann <email@hidden>)
 >Re: Implementing delegates with formal protocols (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: Implementing delegates with formal protocols
  • Next by Date: Re: outlineView:dataCellForTableColumn:item: repeated called w null tableColumn on Snow Leopard
  • Previous by thread: Re: Implementing delegates with formal protocols
  • Next by thread: Re: Implementing delegates with formal protocols
  • Index(es):
    • Date
    • Thread