开发者

Catching exceptions in objective-c

开发者 https://www.devze.com 2023-03-16 22:34 出处:网络
Is there some sort of开发者_如何学Python try/catch function in obj-c? I\'m trying to load saved files from an array and would like to have some sort of message popping up instead of the app crashing i

Is there some sort of开发者_如何学Python try/catch function in obj-c? I'm trying to load saved files from an array and would like to have some sort of message popping up instead of the app crashing in case the array is empty. Whats the best and optimal way to do this?


@try {
    //Code
} 
@catch (id theException) {
    //Code
} 
@finally {
    //Code
}

Or you can test if the array is empty ...

0

精彩评论

暂无评论...
验证码 换一张
取 消