这是一个问题:
if fileManager.fileExistsAtPath(String(pListPath), isDirectory: &isDir)
您不能使用
String(...)将a转换
NSURL为文件路径字符串,而必须使用以下
path方法:
if fileManager.fileExistsAtPath(pListPath.path!, isDirectory: &isDir)
如果
reportsPath也是,
NSURL则存在相同的问题
pListPath = NSURL(fileURLWithPath: String(reportsPath)).URLByAppendingPathComponent("myReports.plist", isDirectory: false)应该是
let pListPath = reportsPath.URLByAppendingPathComponent("myReports.plist", isDirectory: false)


