MKNetWorkKit打印URL
2020-12-13 02:19
标签:ios -(void)initNewUrl:(NSString *)urlString param:(NSMutableDictionary *)_paramDic{ //拼接参数至URL NSMutableString *paramsStr = [[NSMutableString alloc] initWithString@“”]; if(_paramDic!=nil && [_paramDic cout] >0) { NSEnumerator * enumerator = [_paramDic keyEnumerator]; id key; int c = 0; while(key = [enumerator nextObject]){ if(c !=0){ [paramStr appendString:@“&”]; } [paramStr appendFormat:@“%@=%@”,key,[_paramDic objectForKey:key]]; c++; } } NSMutableString *newUrl = [[NSMutableString alloc] initWithString:urlString]; if(paramsStr != nil && [paramsStr length] >0){ NSRange range; range = [newUrl rangOfString:@“?”]; if(range.length!=0){ [newUrl appendFormat:@“&%@”,paramsStr]; }else{ [newUrl appendFormat:@“?%@”,paramsStr]; } } NSLog(@“newUrl=%@”,newUrl); } MKNetWorkKit打印URL,搜素材,soscw.com MKNetWorkKit打印URL 标签:ios 原文地址:http://blog.csdn.net/leochang130731/article/details/25334205