首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

object-c 的错误构造,并抛出

2012-06-27 
object-c 的异常构造,并抛出@try {NSException *exception [NSException exceptionWithName: @HotTeaEx

object-c 的异常构造,并抛出

    @try {        NSException *exception = [NSException exceptionWithName: @"HotTeaException"                                                         reason: @"The tea is too hot"                                                       userInfo: nil];        @throw exception;    }    @catch (NSException *exception) {        NSLog(@"main: Caught %@: %@", [exception name], [exception reason]);    }    @finally {        NSLog(@"finally");    }
?

热点排行