전송 :[NSCFString objectForKey는 :] : 미정 선택기이 코드 인스턴스
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
//---initialize the array---
listOfJMovies = [[NSMutableArray alloc] init];
listOfJMoviePosters = [[NSMutableArray alloc] init];
tmdbMovies = [[NSArray alloc] init];
posters = [[NSArray alloc] init];
thumbs = [[NSArray alloc] init];
//---set the title---
self.navigationItem.title = @"Movies";
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
//NSLog(responseString);
SBJsonParser *json = [[SBJsonParser new] autorelease];
tmdbMovies = [json objectWithString:responseString error:nil];
for (id movie in tmdbMovies) {
[listOfJMovies addObject:[movie objectForKey:@"name"]];
NSLog(@"Name: %@", [movie objectForKey:@"name"]);
//[listOfJMoviePosters addObject:[obj objectForKey:@"posters"]];
//NSLog(@"%@", [obj objectForKey:@"posters"]);
posters = [movie objectForKey:@"posters"];
for (id image in posters) {
NSLog(@"image: %@", [image objectForKey:@"image"]);
thumbs = [image objectForKey:@"image"];
for (id url in thumbs) {
NSLog(@"Size: %@", [url objectForKey:@"size"]);
//NSLog(@"blah");
//[listOfJMoviePosters addObject:[url objectForKey:@"size"]];
}
}
}
[[self tableView] reloadData];
[responseString release];
[connection release];
[responseData release];
}
이 라인 : NSLog (@ "면적 % @", [URL의 objectForKey : @ "크기"]);
2010-12-30 00 : 33 : 29.730 FlixIt
충돌하고 다음과 같은 오류 던져 응용 프로그램을 일으키는 원인이되어 [33132을 : 207] - [NSCFString objectForKey는 :] : 인식 할 수없는 선택기 예를 0x4e50f00 로 전송 2010-12-30 00 : 33 : 29.732 FlixIt [33132 : 207] * 때문에 캐치되지 않는 예외 'NSInvalidArgumentException'응용 프로그램 종료, 이유 : -'[NSCFString objectForKey는 :] 미정 선택기 인스턴스 0x4e50f00 전송' 다음은 JSON입니다. http://api.themoviedb.org/2.1/Movie.browse/en-US/json/e5084159b962a8f0c39096f379a1363c?order_by=rating&order=desc&genres=18&min_votes=5&page=1&per_page=10
고마워요! 그거야. 그러나 'NSArray'응답 할 수 없습니다 '-objectForKey :' – user558096
NSArray NSArray 변경하고 경고를 지우려면 것 같았다. 다시 한 번 감사드립니다! – user558096