如何处理NSFileHandle writeData方法异常?

时间:2016-07-21 06:00:16

标签: ios swift file-handling nsfilehandle

要记录文件中的任何邮件,我使用writeData NSFileHandle方法。有时这个方法抛出一个异常,但我无法处理它,因为代码是用swift编写的。

有什么工作吗?

我试过这个:

I have tried this : NS_INLINE NSException * _Nullable tryBlock(void(^_Nonnull tryBlock)(void)) {
@try {
    tryBlock();
}
@catch (NSException *exception) {
    return exception;
}
return nil;

0 个答案:

没有答案
相关问题