여기에 내 응답 코드가 나와 있습니다.등록 버튼을 누르면 앱이 다운되었지만 데이터가 데이터베이스에 성공적으로 삽입되었습니다.
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
NSDictionary *LoginResult = (NSDictionary*)[responseString JSONValue];
NSLog(@"Success");
NSMutableArray *wholeJsonArray = [LoginResult objectForKey:@"Response"];
for(NSDictionary *countname in wholeJsonArray)
{
NSString *countryName = [countname objectForKey:@"country_name"];
if(countryName)
[countryArray addObject:countryName];
NSString *stateName=[countname objectForKey:@"state_name"];
if(stateName)
[stateArray addObject:stateName];
}
위의 코드는 국가 이름과 statename으로 검색됩니다.
내가 코드를 디버그 할 때 버튼 응용 프로그램이 라인 커서 점 NSString *countryName = [countname objectForKey:@"country_name"];
에 충돌해야합니다.
크래시 로그가 있습니까? –
버튼 누름 코드가 다음을 요청합니다. –
충돌 로그 [__NSCFString objectForKey :] : 인스턴스로 전송 된 인식 할 수없는 선택 자 0x6a6e570 –