Re: Instancetype and refactoring methods
Re: Instancetype and refactoring methods
- Subject: Re: Instancetype and refactoring methods
- From: Jens Alfke <email@hidden>
- Date: Mon, 09 Nov 2015 11:20:09 -0800
> On Nov 9, 2015, at 10:58 AM, Alex Zavatone <email@hidden> wrote:
>
> Before I give it a shot, is this a case where using instancetype to return the instance of the object that holds the method a better choice than id?
It sounds like your delegate API is using the old “informal protocol” mechanism where you declare the methods in a category on NSObject. Instead, it’s best to define a protocol for the delegate type and always refer to the delegate using that protocol. (You’ve probably seen that AppKit and Foundation switched over to this a few years ago.)
—Jens
_______________________________________________
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