Skip to content

Instantly share code, notes, and snippets.

@rbsgn
Created January 17, 2018 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbsgn/f95b0476c18c4dc57a0570ca2de4e0a4 to your computer and use it in GitHub Desktop.
Save rbsgn/f95b0476c18c4dc57a0570ca2de4e0a4 to your computer and use it in GitHub Desktop.
Is this an undefined behaviour in Objective-C?
#import <Foundation/Foundation.h>
@interface Foo : NSObject
@end
@interface Foo (UndefinedBehaviour)
- (void)foo:(id)foo bar:(id)bar;
@end
@interface Bar: Foo
@end
#import "Foo.h"
@implementation Foo
@end
@implementation Foo (UndefinedBehaviour)
- (void)foo:(id)foo bar:(id)bar
{
NSLog(@"@implementation of Foo (UndefinedBehaviour)");
}
@end
@implementation Bar
- (void)foo:(id)foo bar:(id)bar
{
NSLog(@"@implementation Bar");
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment