I'm trying to subclass UIImageView
to add some custom functionality in it. I started trying to do the basics, just init an object with a given image and display it on the screen.
Using UIImageView
everything works fine, but if i change my object from UIImageView
to my custom class, no image is displayed.
Here's what i've done so far:
//Imager.h
#import <UIKit/UIKit.h>
@interface Imager : UIImageView {
}
-(id) init;
-(void) retrieveImageFromUrl: (NSString *)the_URL;
@end
//Imager.m
#import "Imager.h"
@implementation Imager
@synthesize image;
-(id)init
{
self = [super init];
return self;
}
-(void) retrieveImageFromUrl: (NSString *)the_URL{
//Not implemented yet
}
@end
So, i am using this statment: cell.postImage.image = [UIImage imageNamed:@"img.png"];
Before this is executed, i also have postImage = [[UIImageView alloc] init];
If postImage is declared as UIImageView everything works as expected. But if i change it to Imager instead, then nothing is displayed. What am i missing?