Swift_一些遇到的问题
一、Swift-OC混编桥文件
1

2

3

二、Git修改密码报错 remote: Invalid username or password
git config --global user.name "yourname"
git config --global user.email "youremail"
三、把数组保存到plist
存:
let paths = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0]
let plistPath = paths + "/areaForEShop.pist"
let plistUrl = URL.init(fileURLWithPath: plistPath)
array.write(to: plistUrl, atomically: true)
读
读上面存的
let paths = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0]
let plistPath = paths + "/areaForEShop.pist"
let array = NSArray.init(contentsOfFile: plistPath)
直接读取plist文件
let plists = Bundle.main.path(forResource: "areaForEShop", ofType: "plist")!
let resultArray: NSArray = NSArray.init(contentsOfFile: plists)!
四、CoreData
创建CoreData时,如果移动CoreDataClass.swift和CoreDataProperties.swift时搞错,在 TARGETS->Build Phases->Compile Sources中删掉这两个.swift文件就好了。
