title: writeToFile doesn't work for saving photo
body: <pre><code>func fetchFromInternet(){
      let i = Int(DISPATCH_QUEUE_PRIORITY_HIGH.value)
      let que = dispatch_get_global_queue(i, 0)
      dispatch_async(que){
          if let url = NSURL(string: "http://www.hdwallpapers.in/walls/some_are_different-wide.jpg"){
              if let data = NSData(contentsOfURL: url){
                  if let image = UIImage(data: data){
                      dispatch_async(dispatch_get_main_queue()){
                          self.spinner.stopAnimating()
                          self.imageContainer.image = image
                          let manager = NSFileManager.defaultManager()
                          var fileUrl = manager.URLsForDirectory(NSSearchPathDirectory.DocumentDirectory, inDomains: .UserDomainMask).first
                          fileUrl = fileUrl?.URLByAppendingPathComponent("photos")
                          do{
                              try manager.createDirectoryAtURL(fileUrl!, withIntermediateDirectories: false, attributes: nil)
                          }
                          catch{}
                          fileUrl = fileUrl?.URLByAppendingPathComponent("photo.jpg")
                          print(fileUrl)
  
                          if data.writeToFile(String(fileUrl!), atomically: true) {
                              print("saved to file")
                          }
                          else {
                              print("saving failed")
                          }
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>I have problem with this code. It always prints "saving failed". I'm just trying to save photo from internet. Im using some random photo here. Have no idea what I'm doing wrong. Code seems simple and correct.</p>