有没有办法编写某种 catch 语句,([MyArray ObjectAtIndex:myindexpath.row])
以便我可以运行它而不抛出异常?
换句话说,我想写这样的表达式:
if ([MyArray ObjectAtIndex:myindexpath.row]) {
// do some stuff if the object is in the array
else {
// do some other stuff
}
有没有办法编写某种 catch 语句,([MyArray ObjectAtIndex:myindexpath.row])
以便我可以运行它而不抛出异常?
换句话说,我想写这样的表达式:
if ([MyArray ObjectAtIndex:myindexpath.row]) {
// do some stuff if the object is in the array
else {
// do some other stuff
}