UItableViewCell에서 서버의 이미지를로드하고 있습니다.UITableviewcell에서 이미지를로드 할 때 메모리 문제가 발생합니까?
각 이미지 크기가 10MB이므로 메모리에 문제가 발생할 수 있습니다. 나는 tableView
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
locationcellObject=[self.tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
NSDictionary *temp= [sortedArray objectAtIndex:indexPath.row];
locationcellObject.title.text=[temp objectForKey:@"locationtitle"];
locationcellObject.subtitle_Lbl.text=[temp objectForKey:@"category"];
NSString *trimmedtitle = [[temp objectForKey:@"locationtitle"]stringByReplacingOccurrencesOfString:@" " withString:@""];
NSString *name=[NSString stringWithFormat:@"images/%@.png",trimmedtitle];
NSString *imageName=[NSString stringWithFormat:@"http://my_URL_HERE/%@",name];
_tempData = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageName]];
UIImage *display=[[UIImage alloc]initWithData:_tempData];
locationcellObject.locationPic_img_View.image=display;
locationcellObject.locationPic_img_View.contentMode=UIViewContentModeScaleAspectFit;
return locationcellObject;
}
을 통해 스크롤 할 때마다 응용 프로그램은 그것을 할 수있는 쉬운 방법이 있나요 충돌?
어디에서 세포를 할당합니까? –
왜 셀에 10MB 이미지를 사용합니까? 어쨌든 (셀 크기가 이미지만큼 크지 않는 한) 크기가 더 작은 이미지가 충분할 것입니다. – giorashc
'Cell'을위한'NSObject'를 만들었고'ViewDidLoad ' – iCoder