title: Type CCC doesnt conform to protocol 'NSObjectProtocol'
body: <p>I don't understand why my code doesn't work. Here it is:</p>
  
  <pre><code>class Test: NSURLSessionDataDelegate {
  
      func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) {
  
          if(error == nil) {
              print("Hallo")
          } else {
              print(error?.userInfo)
          }
      }
  
      func createRequest() {
  
          let dictionary = [
              "mailAddress":"foo@example.com",
              .....
          ]
  
          let nsData: NSData?
          do {
              nsData = try NSJSONSerialization.dataWithJSONObject(dictionary, options: NSJSONWritingOptions(rawValue:0))
          } catch _ {
              nsData = nil
          }
  
          let defaultConfigObject = NSURLSessionConfiguration.defaultSessionConfiguration()
          let defaultSession = NSURLSession(configuration: defaultConfigObject, delegate: self, delegateQueue: NSOperationQueue.mainQueue())
          let url = NSURL(string: "http:...")!
          let urlRequest = NSMutableURLRequest(URL: url)
          urlRequest.HTTPMethod = "POST"
          urlRequest.HTTPBody = nsData
          urlRequest.addValue("application/json", forHTTPHeaderField: "Content-Type")
          let dataTask = defaultSession.dataTaskWithRequest(urlRequest)
          dataTask.resume()
  
      }
  }
  </code></pre>
  
  <p>And the error:</p>
  
  <blockquote>
    <p>Type Test does not conform to protocol 'NSObjectProtocol'.</p>
  </blockquote>
  
  <p>Any ideas?</p>