iOS异常处理学习笔记
来源:互联网 发布:招银网络 编辑:程序博客网 时间:2024/05/22 13:46
1、Starting with version 3.3 of the GNU Compiler Collection (GCC), make sure the -fobj-exceptions flag is turned on;
2、the macros NS_DURING, NS_HANDLER, and NS_ENDHANDLER 对应于@try @catch
raise对应throw
The exception macros are a legacy mechanism that should only be used when binary compatibility with versions of the operating system prior to OS X v10.3 is a concern.
@try
You can use goto or return to exit an exception handling domain.
NS_DURING, NS_HANDLER
You cannot use goto or return to exit an exception handling domain—errors will result.
3、The uncaught exception handler always causes the program to exit but may perform some task before this happens.
You can set a custom function as the uncaught exception handler using the NSSetUncaughtExceptionHandler function;
you can obtain the current uncaught exception handler with the NSGetUncaughtExceptionHandler function.
4、The generic exception names are string constants defined in NSException.h and documented in Foundation Constants Reference . These constants include the following:
NSGenericException NSRangeException NSInvalidArgumentException NSInternalInconsistencyException NSObjectInaccessibleException NSObjectNotAvailableException NSDestinationInvalidException NSPortTimeoutException NSInvalidSendPortException NSInvalidReceivePortException NSPortSendException NSPortReceiveException
5、64-bit processes that enter a zero-cost @try block incur no performance penalty. This is unlike the mechanism for 32-bit processes, which calls setjmp() and performs additional “bookkeeping”. However, throwing an exception is much more expensive in 64-bit executables.
- iOS异常处理学习笔记
- IOS学习笔记60--异常处理
- 异常处理学习笔记
- java 异常处理学习笔记
- java学习笔记 异常处理
- Java学习笔记(异常处理)
- 学习java异常处理笔记
- Python学习笔记--异常处理
- java异常处理学习笔记
- 7. 异常处理 --- 学习笔记
- c++学习笔记--异常处理
- j2se学习笔记-异常处理
- springMVC学习笔记-异常处理
- Java学习笔记--------异常处理
- Python学习笔记--异常处理
- Python学习笔记--异常处理
- 【Java学习笔记】异常处理
- 《Java异常处理》学习笔记
- IE8 内存一直增长 内存泄露
- MyEclipse 之 修改创建jsp的默认编码格式
- Linux的五个查找命令
- TestNG官方文档中文版(03)—— testng.xml
- wp模拟器启动 提示需要 开启硬件辅助虚拟化
- iOS异常处理学习笔记
- TestNG官方文档中文版(04)—— 运行TestNG
- 决策树
- ANDROID 开发:谷歌地图开发入门(1)--- google map api V1,V2,V3。
- iOS错误之expected specifier-qualifier-list解决方案
- TestNG官方文档中文版(05)—— 测试方法、测试类和测试组
- 小知识点日志2012-11-22 至 2013-1-9
- 几种函数调用方式
- 僵尸进程,孤儿进程,wait,exit,execl等函数使用要点