아래와 같이,AFNetworking + UIImageView에 자리 표시 자 이미지가 나타납니다,하지만 URL 이미지
이[self.image setImageWithURL:[NSURL URLWithString:feed.imageURL] placeholderImage: [UIImage imageNamed:@"logo"]];
자리 표시 자 이미지가 항상 표시되지만 "feed.imageURL"의 실제 이미지는 절대 사용하지 않습니다. URL이 실제로 올바른지 확인했습니다. 나는 심지어 그것을 하드 코딩하여, 여전히 아무것도 만들지 않았다.
내 기본 앱 설정은 탭 컨트롤러이고 viewDidLoad에서는 HTTP 요청으로 JSON 데이터를 수집하는 fetchFeed 메소드를 호출합니다.
AFJSONRequestOperation *operation = [AFJSONRequestOperation
JSONRequestOperationWithRequest:request
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
[self parseDictionary:JSON];
isLoading = NO;
[self.tableView reloadData];
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
NSLog(@"Error: %@", error);
[self showNetworkError];
isLoading = NO;
[self.tableView reloadData];
}];
operation.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html", nil];
[queue addOperation:operation];
를 수정하지 않고 그것을 지원할 수 UITableViewCells 내 이미지가 있습니까? 'cellForRowAtIndexPath :'delegate 메소드에서'setImageWithURL'을 호출하고 있습니까? – jonkroll
예, 두 가지 질문에 모두 동의합니다. –
'tableView : cellForRowAtIndexPath :'에 원격 이미지를 설정하는 코드를 포함시킬 수 있습니까? – mattt