> On Aug 18, 2015, at 9:53 AM, Richard Charles <rcharles...@gmail.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to