我注册未捕获异常处理程序的代码UncaughtExceptionHandler
如下,你认为会有什么潜在的问题吗?
@interface AppDelegate ()
void myHandler(NSException * exception);
@end
@implementation AppDelegate
void myHandler(NSException * exception)
{
// ...
}
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSSetUncaughtExceptionHandler(&myHandler);
..
是否有可能有更简洁的方式来编写它?
我需要使用类扩展来声明原型,以摆脱No previous prototype for function 的警告。