美文网首页iOS Developer
JSONSerialization Invalid type i

JSONSerialization Invalid type i

作者: DamonLu | 来源:发表于2016-12-13 16:32 被阅读605次

    在使用AFNetworking进行网络请求时, 参数的类型如果不对, 会报错, 原因如下:

    An object that may be converted to JSON must have the following properties:

    The top level object is an NSArray or NSDictionary. All objects are instances of NSString, NSNumber, NSArray, NSDictionary, or NSNull.

    All dictionary keys are instances of NSString. Numbers are not NaN or infinity.

    Other rules may apply. Calling isValidJSONObject(_:) or attempting a conversion are the definitive ways to tell if a given object can be converted to JSON data.

    相关文章

      网友评论

        本文标题:JSONSerialization Invalid type i

        本文链接:https://www.haomeiwen.com/subject/nglbmttx.html