nsobjectprotocol

Type CCC doesnt conform to protocol 'NSObjectProtocol'

微笑、不失礼 提交于 2019-11-30 00:40:25
问题 I don't understand why my code doesn't work. Here it is: 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 _ {