Re: Mantaining legacy APIs in a framework
Re: Mantaining legacy APIs in a framework
- Subject: Re: Mantaining legacy APIs in a framework
- From: Jens Alfke <email@hidden>
- Date: Mon, 31 Aug 2015 16:24:34 -0700
> On Aug 31, 2015, at 4:09 PM, Graham Cox <email@hidden> wrote:
>
> So the framework needs to arrange that if -foo:withBar: wasn’t overridden, but -foo: was, it should invoke the older override for backward compatibility until the client code is revised.
One way to do it is something like
@implementation BaseClass
...
if ([self methodForSelector: @selector(foo:)] != [BaseClass instanceMethodForSelector: @selector(foo:)]) {
// self must be an instance of a subclass that’s overridden -foo:.
}
—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