This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Abstract.h | |
static inline NSException *UnimplementedMethodException(SEL cmd, Class klass) { | |
NSString *reason = | |
[NSString stringWithFormat:@"Implementation missing for abstract method: %@; class: %@", | |
NSStringFromSelector(cmd), NSStringFromClass(klass)]; | |
return [NSException exceptionWithName:NSInternalInconsistencyException | |
reason:reason | |
userInfo:nil]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Derived class contains an instance method that calls a function foo() in its scope. | |
class Base {} | |
func foo() -> String { | |
return "function foo()" | |
} | |
class Derived: Base { | |
func bar() -> String { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void uncaughtExceptionHandler(NSException *exception) { | |
NSLog(@"EXCEPTION: %@", exception); | |
NSLog(@"Stack trace: %@", [exception callStackSymbols]); | |
} | |
int main(int argc, char *argv[]) { | |
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler); | |
@autoreleasepool { | |
return UIApplicationMain(argc, argv, nil, NSStringFromClass([MyAppDelegate class])); | |
} |