标签:http io os ar sp div on c log
1,iOS中AFN Get请求包含中文时崩溃
NSString *search = @"http://60.206.137.156:8020/video_api/user/search/51234562346412e86a730d94fef7cc73/中";
[manger GET: search parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"responseObject - %@",responseObject);
// NSString *str = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
// NSLog(@"str -- %@",str);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"erro - %@",error);
}];
会崩溃
处理方案 search = [search stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
标签:http io os ar sp div on c log
原文地址:http://www.cnblogs.com/ndyBlog/p/3998855.html