osx - Xcode Cocoa text field to equal file path -


how can have top text field equal path selected user? i'm new xcode appreciated.

import cocoa  class viewcontroller: nsviewcontroller {      @ibaction func browsedmf(sender: nsopenpanel) {          var openpanel = nsopenpanel()         openpanel.allowsmultipleselection = false         openpanel.canchoosedirectories = true         openpanel.cancreatedirectories = false         openpanel.canchoosefiles = false         openpanel.beginwithcompletionhandler { (result) -> void in             if result == nsfilehandlingpanelokbutton {              }         }     }      @iboutlet weak var textfielddmf: nstextfield! 

screenshot

here updated code:

import cocoa  class viewcontroller: nsviewcontroller {      @ibaction func browsedmf(sender: nsopenpanel) {          var openpanel = nsopenpanel()         openpanel.allowsmultipleselection = false         openpanel.canchoosedirectories = true         openpanel.cancreatedirectories = false         openpanel.canchoosefiles = false         openpanel.beginwithcompletionhandler { (result) -> void in             if result == nsfilehandlingpanelokbutton {                nsurl *pathurl = [[openpanel urls] objectatindex:0];                [textfielddmf setstringvalue:[pathurl absolutestring]];             }         }     }      @iboutlet weak var textfielddmf: nstextfield! 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -