Skip to content

Instantly share code, notes, and snippets.

@shnhrrsn
Created March 10, 2012 20:18
Show Gist options
  • Select an option

  • Save shnhrrsn/2012947 to your computer and use it in GitHub Desktop.

Select an option

Save shnhrrsn/2012947 to your computer and use it in GitHub Desktop.
@implementation ExampleCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
imageView = [[EGOImageView alloc] initWithPlaceholderImage:[UIImage imageNamed:@"placeholder.png"]];
imageView.frame = CGRectMake(4.0f, 4.0f, 36.0f, 36.0f);
[self.contentView addSubview:imageView];
}
return self;
}
- (void)setFlickrPhoto:(NSString*)flickrPhoto {
imageView.imageURL = [NSURL URLWithString:flickrPhoto];
}
- (void)willMoveToSuperview:(UIView *)newSuperview {
[super willMoveToSuperview:newSuperview];
if(!newSuperview) {
[imageView decreaseImageLoadPriority];
}
}
- (void)dealloc {
[imageView release];
[super dealloc];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment