I have tried following libraries for Image cache:
SDWebImage
UIImageView+AFNetworking
But still app getting Memory Warning, crashed and stuck while scrolling.
I have used UITableViewCell
for display image.
Some of the images are 1.5 MB or more, So i am not sure whether this is the issue or anything else?
Please guide. Any efforts from your side will be appreciated.
EDIT:
I have UITableViewCell
for load UICollectionViewCell
in UITableView
:
Code for UITableViewCell.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"homecell";
HomeViewCell *cell = (HomeViewCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"HomeViewCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
NSArray *arr=[[arrPsots objectAtIndex:indexPath.row ] valueForKey:@"PostImage"];
[cell setCollectionWithImageArray:arr];
return cell;
}
Code for UICollectionViewCell.
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView1 cellForItemAtIndexPath:(NSIndexPath *)indexPath{
static NSString *cellIdentifier = @"ScrollCollectionCell";
ScrollCollectionCell *cell = [collectionView1 dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];
NSString *imgKey = (IS_IPAD?@"PostImage":@"PostImage");
NSString *strImage=[NSString stringWithFormat:@"%@",[arrImages valueForKey:imgKey]];
[cell.imgScroll setImageWithURL:[NSURL URLWithString:strImage] placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
if ([arrImages count]==1) {
self.pageControllPostImg.hidden=TRUE;
}
self.pageControllPostImg.hidden=TRUE;
self.pageControllPostImg.numberOfPages=[arrImages count];
return cell;
}