1
저는 iPhone 개발에 익숙하지 않습니다. xcode 4.2를 사용하고 있습니다. 수신 신호 : 웹 서비스 호출 기능의 EXC_BAD_ACCESS
내가 저장 버튼을 클릭
, 나는 HTML 페이지에서 값을 받고 있어요 내 웹 서비스를 처리하고 난 오류 얻을 : 내 웹 서비스 호출 기능에program received signal: EXC_BAD_ACCESS
합니다. 여기 내 코드는 다음과 같습니다.
NSString *val=[WebviewObj stringByEvaluatingJavaScriptFromString:@"save()"];
NSLog(@"return value:: %@",val);
[adict setObject:[NSString stringWithFormat:@"%i",userid5] forKey:@"iUser_Id" ];
[adict setObject:[[val componentsSeparatedByString:@","]objectAtIndex:0] forKey:@"vImage_Url"];
[adict setObject:[[val componentsSeparatedByString:@","]objectAtIndex:1] forKey:@"IGenre_Id"];
[adict setObject:[[val componentsSeparatedByString:@","]objectAtIndex:2] forKey:@"vTrack_Name"];
[adict setObject:[[val componentsSeparatedByString:@","]objectAtIndex:3] forKey:@"vAlbum_Name"];
[adict setObject:[[val componentsSeparatedByString:@","]objectAtIndex:4] forKey:@"vMusic_Url"];
[adict setObject:[[val componentsSeparatedByString:@","]objectAtIndex:5] forKey:@"iTrack_Duration_min"];
[adict setObject:[[val componentsSeparatedByString:@","]objectAtIndex:6] forKey:@"iTrack_Duration_sec"];
[adict setObject:[[val componentsSeparatedByString:@","]objectAtIndex:7] forKey:@"vDescription"];
NSLog(@"dict==%@",[adict description]);
NSString *URL2= @"http://184.164.156.55/Music/Track.asmx/AddTrack";
obj=[[UrlController alloc]init];
obj.URL=URL2;
obj.InputParameters = adict;
[obj WebserviceCall];
obj.delegate= self;
//this is my function..it is working for so many function calls
-(void)WebserviceCall{
webData = [[NSMutableData alloc] init];
NSMutableURLRequest *urlRequest = [[ NSMutableURLRequest alloc ] initWithURL: [ NSURL URLWithString: URL ] ];
NSString *httpBody = @"";
for(id key in InputParameters)
{
if([httpBody length] == 0){
httpBody=[httpBody stringByAppendingFormat:@"&%@=%@",key,[InputParameters valueForKey:key]];
}
else{
httpBody=[httpBody stringByAppendingFormat:@"&%@=%@",key,[InputParameters valueForKey:key]];
}
}
httpBody = [httpBody stringByAppendingFormat:httpBody];//Here i am getting EXC_BAD_ACCESS
[urlRequest setHTTPMethod: @"POST" ];
[urlRequest setHTTPBody:[httpBody dataUsingEncoding:NSUTF8StringEncoding]];
[urlRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self];
}
아무쪼록 도와 주시겠습니까? 사전