尝试&赶上 iPhone?

try amp; catch in iPhone?(尝试amp;赶上 iPhone?)

本文介绍了尝试&赶上 iPhone?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

try{}catch 结构对于 C++、Java 和相关语言.iOS SDK 中有没有类似的功能?

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

推荐答案

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

这篇关于尝试&赶上 iPhone?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:尝试&赶上 iPhone?

基础教程推荐