내가 네 사진을 포함하고 내가 웹에서이 사진을 얻을하지만 난이 사진이 사진을 다운로드하면 어떻게 저장할 수 있습니까?
다시 다운로드하는 jQuery과 아래로 스크롤 할 때 문제가 그리고이 코드입니다있는 UITableViewCell이 있습니다
ITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellPhoto"];
if (cell == nil) {
NSArray *nibObject = [[NSBundle mainBundle] loadNibNamed:@"CustomCellThumbnails" owner:self options:nil];
cell = [nibObject objectAtIndex:0];
}
// Get the photos
int getPhotos = indexPath.row * 4;
for (int i = 1; i <= 4; i++) {
if (getPhotos < [imageArray count])
{
UIButton *imageButton = (UIButton*)[cell viewWithTag:i];
NSString *url = [imageArray objectAtIndex:getPhotos];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.siteweb.com%@",url]]];
UIImage *imageFieldProfile = [[UIImage alloc] initWithData:imageData];
dispatch_async(dispatch_get_main_queue(), ^{
// Set the phoyo to the UIButton
[imageButton setBackgroundImage:imageFieldProfile forState:UIControlStateNormal];
[imageFieldProfile release];
// Set the corner of UIButton
[imageButton.layer setCornerRadius:5.0];
[imageButton.layer setMasksToBounds:YES];
imageButton.tag = getPhotos;
});
});
[imageButton addTarget:self action:@selector(displayPhoto:) forControlEvents:UIControlEventTouchUpInside];
}
getPhotos ++;
}
을
하지만 난 initWithStyle와있는 UITableViewCell 만드는 방법 펜촉 파일에 사용자 지정있는 UITableViewCell이있는 경우 : reuseIdentifier : usingCacheTable : –
아무 생각 - 속성으로 추가하고 '사용을 고려 [세포 setMyCache을 :]'대신. –