Re: Private Methods
Re: Private Methods
- Subject: Re: Private Methods
- From: Jens Alfke <email@hidden>
- Date: Tue, 18 Aug 2015 10:20:25 -0700
> On Aug 18, 2015, at 9:53 AM, Richard Charles <email@hidden> wrote:
>
> OBJC_PRINT_REPLACED_METHODS logs methods replaced by category implementations. If the replaced method is not in a category then it does not work. :-(
Yeah, there’s no way for the runtime to tell the difference between an ‘expected’ method override and an ‘unexpected’ one.
This is one of the reasons a lot of newer languages (like Swift) make you add an explicit “override” keyword to an overridden method declaration. That way the compiler and/or runtime can detect an unexpected override and issue an error.
But would Swift have caught this issue, since the CALayer.context property isn’t visible in headers at all, only in the compiled code?
—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