jjzjj

PrinterError

全部标签

ios - 在 Swift 中捕获默认错误

我正在努力学习Swift,想知道Apple对以下实验的预期答案,该答案在Apple的GuidedTour的错误处理部分提供。Playground如下;Experiment:Addcodetothrowanerrorinsidethedoblock.Whatkindoferrordoyouneedtothrowsothattheerrorishandledbythefirstcatchblock?Whataboutthesecondandthirdblocks?enumPrinterError:ErrorType{caseOutOfPapercaseNoTonercaseOnFire}f