try & catch in iPhone?

泪湿孤枕 提交于 2019-11-30 06:32:35

问题


The try{}catch construct is common to C++, Java & related languages. In the iOS SDK is there and any functionality like this?


回答1:


@try {
    // Try something
}
@catch (NSException * e) {
    NSLog(@"Exception: %@", e); 
}
@finally {
    // Added to show finally works as well
}


来源:https://stackoverflow.com/questions/5704038/try-catch-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!