*** Assertion failure in -[AFJSONRequestSerializer requestWithMethod:URLString:parameters:error:],

在使用AFNetworking时,如果Url中包含空格,文字,或者特殊字符时,会崩溃:

[AFJSONRequestSerializer requestWithMethod:URLString:parameters:error:]

解决办法:

NSString *url = [NSString stringWithFormat:@"请求的链接"];

NSString *requestUrl = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; 

上一篇:华为联运游戏或应用审核驳回:配置hms升级provider名称有误


下一篇:HMS Core赋能移动金融,为行业注入增长新动力