Objective-C 异常处理
2015-11-28 18:43
399 查看
#import <UIKit/UIKit.h> #import "AppDelegate.h" int main(int argc, char * argv[]) { @try { // 抛出一个自定义异常 @throw [NSException exceptionWithName:@"My Error" reason:nil userInfo:nil]; } @catch (NSException *exception) { // 处理异常 NSLog(@"%@",exception); } @finally { // 运行 NSLog(@"run"); } @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } }
相关文章推荐
- Objective-C 类型判断
- Object的clone()方法、深拷贝、浅拷贝
- Qt Object 类简介--Qt 类简介专题(二)
- Objective-C Delegate
- IOS开发基础Object-C(11)—Category语法
- Objective-C 协议(接口)
- python -【mongo】 处理ObjectID
- [Object C]_[初级]_[创建文件路径时,已存在同名目录和文件名的问题的解决方案]
- [Objective-C A]-知识点锦集
- 126 You executed the following commands in a database session: SQL> SELECT object_name, original_nam
- Objective-C的m文件中定义变量
- Objective-C中的内存管理——手动内存管理
- jedis异常:Timeout waiting for idle object
- Creating and destroying objects
- Motion-Based Multiple Object Tracking
- objective - C 下字符串的处理方法
- Object类
- Objective-C 重写set方法
- Objective-C 笔记二 类、对象和方法
- Objective-C 字典、可变字典