title: Calling function in ViewController but parameters seems wrong
body: <p>I created a custom class to save a array of Products in NSUserDefaults, but when I will test in my ViewController, I always get this using the autocomplete from Xcode 7.1</p>
  
  <p><a href="https://i.stack.imgur.com/HG5yF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HG5yF.png" alt="function"></a></p>
  
  <p>The function <em>saveToFile</em> or <em>loadFromFile</em> always shows <code>self: DataFile</code> as unique parameter.</p>
  
  <p>This is my DataFile class</p>
  
  <pre><code>import Foundation
  
  class DataFile {
      let userDefaults = NSUserDefaults.standardUserDefaults()
  
      func saveToFile&lt;T&gt;(object: [T], key: String) -&gt; String {
          let encodedData = NSKeyedArchiver.archivedDataWithRootObject(object as! AnyObject)
  
          self.userDefaults.setObject(encodedData, forKey: key)
          self.userDefaults.synchronize()
  
          return "oi"
      }
  
      func loadFromFile&lt;T&gt;(key: String) -&gt; [T]? {
          let decoded = self.userDefaults.objectForKey(key) as! NSData
  
          if let decodedProducts = NSKeyedUnarchiver.unarchiveObjectWithData(decoded) as? [T] {
              return decodedProducts
          }
  
          return nil
      }
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Thank you</p>