博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
iOS异常处理学习笔记
阅读量:6905 次
发布时间:2019-06-27

本文共 1676 字,大约阅读时间需要 5 分钟。

  hot3.png

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 对应于 @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.
 
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 
 
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.

 

转载于:https://my.oschina.net/dake/blog/196716

你可能感兴趣的文章
[Javascript] Fetch API
查看>>
[改善Java代码]不使用stop方法停止线程
查看>>
Spring Boot新模块devtools
查看>>
关于Android读取不同位置(drawable,asset,SDCard)的图片资源的总结
查看>>
HAProxy的三种不同类型配置方案
查看>>
Unity3d之截图
查看>>
Windows下的Jdk 1.7*安装并配置(图文详解)
查看>>
JS判断客户端是手机还是PC的2个代码(转)
查看>>
分布式服务框架设计和实现
查看>>
dispatchTouchEvent
查看>>
Zabbix-3.0.3实现微信(WeChat)告警
查看>>
ArcGIS for Desktop入门教程_第三章_Desktop软件安装 - ArcGIS知乎-新一代ArcGIS问答社区...
查看>>
解决客户端访问https报错
查看>>
PHPCMS列表循环序列号自增标签代码
查看>>
2016年第15本:微信营销与运营----策略、方法、技巧与实践
查看>>
HTML之Data URL(转)
查看>>
注解式控制器
查看>>
ASP.Net中实现上传过程中将文本文件转换成PDF的方法
查看>>
maven The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path错误
查看>>
【数据库】数据库的并发问题与锁机制
查看>>