swift programming NSErrorPointer error etc

后端 未结 4 2061
我在风中等你
我在风中等你 2021-01-01 08:23
var data: NSDictionary = 
    NSJSONSerialization.JSONObjectWithData(responseData, options:NSJSONReadingOptions.AllowFragments, error: error) as NSDictionary;
         


        
4条回答
  •  旧巷少年郎
    2021-01-01 09:11

    Check With below code:

    var error: AutoreleasingUnsafePointer=nil
    var dataVal: NSData =  NSURLConnection.sendSynchronousRequest(request1, returningResponse: response, error:nil)
    var err: NSError?
    var jsonResult: NSDictionary = NSJSONSerialization.JSONObjectWithData(dataVal, options: NSJSONReadingOptions.MutableContainers, error: nil) as NSDictionary
        println("Result\(jsonResult)")
    

    Try using

     var error: AutoreleasingUnsafePointer=nil
    

提交回复
热议问题