标签:error interface api apple app odi nslog nil sea
- (void)seabc
{
NSArray *arry=[NSArray arrayWithObjects:@"0081",@"0082",@"0083", nil];
NSString *ss = [self objArrayToJSON:arry];
NSString * datsa = [NSString stringWithFormat:@"pictures=%@",ss];
NSLog(@"jsonStr==%@",datsa);
NSString *url = [NSString stringWithFormat:@"http://app.y-x-q.cn/index.php/interfaces/Articleapi/test1"];
[RequstHttp postWithPathURL:url params:datsa succes:^(NSData *json) {
NSLog(@"json:%@",[[NSString alloc]initWithData:json encoding:NSUTF8StringEncoding]);
} failure:^(NSError *error) {
}];
}
//把多个json字符串转为一个json字符串
- (NSString *)objArrayToJSON:(NSArray *)array {
NSString *jsonStr = @"[";
for (NSInteger i = 0; i < array.count; ++i) {
if (i != 0) {
jsonStr = [jsonStr stringByAppendingString:@","];
}
jsonStr = [jsonStr stringByAppendingString:array[i]];
}
jsonStr = [jsonStr stringByAppendingString:@"]"];
return jsonStr;
}
标签:error interface api apple app odi nslog nil sea
原文地址:http://www.cnblogs.com/shenlaiyaoshi/p/7776784.html