我复制了这样一个文件:
let fontFolderPath = "/Users/meeeee/Library/Fonts/"
let allFontsPath = "/Users/meeeee/Desktop/all_fonts/Pacifico.ttf"
var error:NSDictionary?
@IBAction func changeFonts(sender: AnyObject) {
do{
try NSFileManager.defaultManager().copyItemAtPath(allFontsPath, toPath: fontFolderPath)
}
catch{
}
}
不会抛出任何错误,但在手动检查/Users/meeeee/Library/Fonts/
时,Pacifico.ttf不存在。我做错了什么?