Skip to content

Instantly share code, notes, and snippets.

@Catfish-Man
Created June 10, 2016 00:12
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 Catfish-Man/8285a1705a92b9a0b4dac1b918ac2426 to your computer and use it in GitHub Desktop.
Save Catfish-Man/8285a1705a92b9a0b4dac1b918ac2426 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
NS_ROOT_CLASS
@interface KVOTest
@end
@implementation KVOTest
@end
int main() {
id test = class_createInstance(objc_getClass("KVOTest"), 0);
[test addObserver:test forKeyPath:@"self" options:0 context:NULL];
return 0;
}
@Catfish-Man
Copy link
Author

2016-06-09 17:11:57.475 rootclasstest[1646:86595] *** NSForwarding: warning: object 0x7fe20b4054c0 of class 'KVOTest' does not implement methodSignatureForSelector: -- did you forget to declare the superclass of 'KVOTest'?
2016-06-09 17:11:57.475 rootclasstest[1646:86595] *** NSForwarding: warning: object 0x7fe20b4054c0 of class 'KVOTest' does not implement doesNotRecognizeSelector: -- abort
fish: './rootclasstest' terminated by signal SIGTRAP (Trace or breakpoint trap)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment