实验项目3――基本线性表运算(顺序存储方式)
2011-10-16 13:55
387 查看
void SignalHandler(int signal) { //中断信号 }
void uncaughtExceptionHandler(NSException *exception) { //未捕获异常 }
安装(与全局异常断点冲突,当有这样的断点是,下面拦截函数失效)
void InstallUncaughtExceptionHandler() { NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler); signal(SIGABRT, SignalHandler); signal(SIGILL, SignalHandler); signal(SIGSEGV, SignalHandler); signal(SIGFPE, SignalHandler); signal(SIGBUS, SignalHandler); signal(SIGPIPE, SignalHandler); }
3.具体实例
1.http://cocoawithlove.com/2010/05/handling-unhandled-exceptions-and.html
重点在于尝试继续运行程序
告诉用户那些因为这些未拦截的异常和信号导致的崩溃,或者自己记录,甚至可以避开这样导致的崩溃.不过,如果多个信号拦截了,这可能失效.
非常推荐看看这篇文章
2.http://parveenkaler.com/2010/08/11/crashkit-helping-your-iphone-apps-suck-less/
重点在于记录异常(之后返回主线程)
- (void)pumpRunLoop { self.finishPump = NO; CFRunLoopRef runLoop = CFRunLoopGetCurrent(); CFArrayRef runLoopModesRef = CFRunLoopCopyAllModes(runLoop); NSArray * runLoopModes = (NSArray*)runLoopModesRef; while (self.finishPump == NO) { for (NSString *mode in runLoopModes) { CFStringRef modeRef = (CFStringRef)mode; CFRunLoopRunInMode(modeRef, 1.0f/120.0f, false); // Pump the loop at 120 FPS } } CFRelease(runLoopModesRef); }
相关文章推荐
- 第三周实践项目1--顺序表的基本运算(2)线性表长度,查找元素
- 第三周实践项目1(2)--顺序表的基本运算插入.删除数据,初始化.销毁线性表
- 实验项目4――基本线性表就地逆置(顺序结构)
- 实验项目4——基本线性表就地逆置(顺序结构)
- 第三周实践项目1--顺序表的基本运算(3)插入.删除数据,初始化.销毁线性表
- C/C++ 第三周线性表项目(1) 顺序表的基本运算
- 第三周项目1---顺序表的基本运算
- 第三周项目1-顺序表的基本运算
- 第三周项目1-顺序表的基本运算
- 第三周项目一 顺序表的基本运算
- 第三周项目1-顺序表的基本运算
- 第三周 项目一——顺序表的基本运算(1)
- 【项目1-顺序表的基本运算】
- 数据结构-双栈-顺序存储-基本运算
- 第三周 【项目1 - 顺序表的基本运算】
- 第十一周 二叉树 项目1 二叉树的链式存储及基本运算
- 第三周项目1-顺序表的基本运算
- 【第三周】项目1-顺序表的基本运算
- 第三周项目1 顺序表的基本运算(3)
- 第3周、项目1—顺序表的基本运算