私はObjectiveCJSON解析ライブラリを使用しています。私のWebサービスはJSON応答を返します。応答文字列に「\」文字が含まれているため、パーサーが失敗します。応答文字列はのようです":\/\/68.491.5.780\/iphoneapplication"
が、私はのようになりたいです"://68.491.5.780/"
。
私のコードはここにあります:
NSURL *url=[NSURL URLWithString:
@"http:// url address/Accountservice/Security/ValidateAccess?accesscode=abcd&type=0"];
NSData *postData =
[post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
では、Webサービスから受信した応答のすべての円記号 "\"を削除するにはどうすればよいですか?