此代码曾用于Swift和Xcode Beta:
@IBAction func chooseTargerDir(sender: AnyObject) {
let myFiledialog:NSOpenPanel = NSOpenPanel()
myFiledialog.allowsMultipleSelection = false
myFiledialog.canChooseDirectories = true
myFiledialog.runModal()
var chosenfile = myFiledialog.URL
arg2.stringValue = chosenfile.path
现在在Xcode 6.1中,我收到错误:
'NSURL?' does not have a member 'path'