这是我的响应代码。
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];
}
上面的代码是检索到 country name 和 statename 。
NSString *countryName = [countname objectForKey:@"country_name"];
当我在按下按钮后调试我的代码时,应用程序应该在行光标点崩溃。