例如这种系统的方法。后面带着throws的如何实现它;
public func createDirectoryAtPath(path: String, withIntermediateDirectories createIntermediates: Bool, attributes: [String : AnyObject]?) throws
//实现它
do {
try FM.createDirectoryAtPath(cachePath, withIntermediateDirectories: true, attributes: nil)
} catch let error as NSError{
print("存储路径错误-->\(error)")
}