NSJSONSerialization类抛出异常处理(swift)

        do{it

            let dic:NSDictionary = try  NSJSONSerialization.JSONObjectWithData(NSData(), options: NSJSONReadingOptions.AllowFragments) as! NSDictionaryio

            print(dic)error

            

        }catch let error  as NSError{di

        

            print(error)let

        }

相关文章
相关标签/搜索