title: Trying to DateFormatting Optional String
body: <p>Currently i'm getting all the invoice data from my Rails API.</p>
  
  <pre><code>func get(path: String) {
      let url = NSURL(string: path)
      let session = NSURLSession.sharedSession()
      let task = session.dataTaskWithURL(url!, completionHandler: {data, response, error -&gt; Void in
          if(error != nil) {
              print(error!.localizedDescription)
          }
          do {
              let results = try NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.MutableLeaves)
              self.delegate.didReceiveAPIResults(results as! NSArray)
          } catch {
              print("Error")
          }
      })
  
      task!.resume()
  }
  </code></pre>
  
  <p>Then i pass the array with results to my delegate in the InvoicesController:</p>
  
  <pre><code>func didReceiveAPIResults(results: NSArray) {
      let dateFormatter = NSDateFormatter()
      dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
      dispatch_async(dispatch_get_main_queue(), {
          for invoice in results {
              // Create an individual item
              Invoice.createInManagedObjectContext(self.managedObjectContext,
                  invoiceStatus: String(invoice["status"]),
                  invoicePrice: NSDecimalNumber(string: String(invoice["price"])),
                  invoiceDate: dateFormatter.dateFromString("2015-06-22T17:57:21.313Z")!,
                  invoiceDueDate: String(invoice["invoice_date"])
  
              )
          }
      })
  }
  </code></pre>
  
  <p>But i can't convert the invoice["invoice_date"] optional to an valid date, currently it returns an nil.</p>
  
  <p>I've tried some things in the Playground and there it works with an Optional value:</p>
  
  <pre><code>let dateFormatter = NSDateFormatter()
  dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
  
  var dateString:String? = "2015-06-22T17:57:21.313Z"
  
  dateFormatter.dateFromString(dateString!)
  </code></pre>
  
  <p>By using:</p>
  
  <pre><code>invoiceDate: dateFormatter.dateFromString(String(invoice["invoice_date"]))!
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <pre><code>fatal error: unexpectedly found nil while unwrapping an Optional value (lldb) 
  </code></pre>
  
  <p>Someone some suggestions? I'm using swift 2 on iOS 9 platform.</p>