json を解析していますが、url は整数値を返しています。(例: 278)
-(void) connectionDidFinishLoading: (NSURLConnection *) connection{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
NSString *responseString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSLog(@"JSON Response = %@",responseString);}
NSLog で応答を出力すると、次のような結果が得られます
2012-09-15 18:02:02.091 Web Service[5190:f803] JSON Response = "278"
出力を引用符で囲みたくありません。みたいに欲しい
2012-09-15 18:02:02.091 Web Service[5190:f803] JSON Response = 278
どうすればこれを達成できますか?
JSON
NSString *urlString = [NSString stringWithFormat:@"http://10.5.6.105/ARAPPWS/Service1/InsertEmp/name=%@,phone=%@",name.text,number.text];
NSURL *addUrl = [NSURL URLWithString:urlString];
NSURLRequest *addRequest = [NSURLRequest requestWithURL:addUrl];
(void)[NSURLConnection connectionWithRequest:addRequest delegate:self];
-(void) connection: (NSURLConnection *) connection didReceiveResponse:(NSURLResponse *)response
{
jsonData = [[NSMutableData alloc]init];
}
-(void) connection: (NSURLConnection *) connection didReceiveData:(NSData *)data
{
[jsonData appendData:data];
}
-(void) connectionDidFinishLoading: (NSURLConnection *) connection
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
responseString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[self performSelector:@selector(uploadEmpImg:) withObject:nil afterDelay:1];
}
前もって感謝します。