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

        }

相關文章
相關標籤/搜索