0
간단한 json 응답에서 데이터를 가져 오려고합니다. NSDictionary에서 json 데이터 가져 오기
첫 번째 로그
내가 뭘 잘못[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x72de3b0
를 얻을 그러나 나는 그것에서 objectForKey 사용할 수 없습니다, 내가 access_token이라는 항목을 찾을 수 있음을 보여줍니다?
for(NSDictionary *item in authResponse)
{
NSString *s1 = @"access_token";
NSString *s2 = [item description];
NSLog(@"access desc: %@", [item description]);
if([s1 isEqualToString:s2]){
NSLog(@"Item: %@", [item objectForKey:@"access_token"]);
}
}
'NSString' 객체가 아닌'NSString' 객체에서'objectForKey'를 호출하고 있습니다. – trojanfoe
내 json 객체가 올바른 json 객체입니다. 어떻게 json 문자열을 사전으로 변환합니까? –