码迷,mamicode.com
首页 > 移动开发 > 详细

iOS之异常处理

时间:2014-07-23 13:54:56      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:http   使用   os   io   re   c   

每当出现bug或者crash的时候,我们总是习惯性的加入了NSLog或则单步调试。但是往往有些时候总找不到莫名奇妙的原因,回头看看C++对于异常处理的一些总结。

@try {
    <#Code that can potentially throw an exception#>
}
@catch (NSException *exception) {
    <#Handle an exception thrown in the @try block#>
}
@finally {
    <#Code that gets executed whether or not an exception is thrown#>
}

看着这个东西真的好熟悉,虽然说在iOS开发很少见到抛出异常这个东西,不自觉的便使用了。

自己写了一个例子,具体看例子吧。例子已上传git

下载地址

iOS之异常处理,布布扣,bubuko.com

iOS之异常处理

标签:http   使用   os   io   re   c   

原文地址:http://my.oschina.net/CgShare/blog/294087

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!