title: How do I convert NSOpenPanel.URL to a string?
body: <p>I was trying to display an open file dialog in OSX via Xcode and Swift.
  I then wanted to put the filename in a TextField.</p>
  
  <p>I started with </p>
  
  <pre><code>@IBOutlet weak var lblFileName: NSTextField!
  @IBAction func FileOpen(sender: AnyObject) {   
      var f:NSOpenPanel = NSOpenPanel()
      f.title = "open that file"
      f.allowsMultipleSelection = false
      f.canChooseDirectories = false
      f.runModal()
      var thefile = f.URLs[0].absoluteString
      println(thefile)
      //failed: lblFileName.stringValue = thefile
      lblFileName.stringValue = "I want this to be the filename!"
  }
  </code></pre>
  
  <p>println(thefile) worked, so it was just an issue with converting the URL
  The variable "thefile" wasn't a string and all attempts to cast it failed. </p>
  
  <p>I did get it working so I thought I'd post the answer here as well.</p>