tengo el siguiente código:UIImageView no Muestra la imagen
@interface NeighborProfileViewController : UIViewController {
UIImageView * profPic;
UITextView * text;
UIButton * buzz;
NSString * uid;
NSMutableData *responseData;
NSDictionary * results;
}
@property (nonatomic, retain) IBOutlet UIImageView * profPic;
@property (nonatomic, retain) IBOutlet UITextView * text;
@property (nonatomic, retain) IBOutlet UIButton * buzz;
@property (nonatomic, retain) NSString * uid;
@end
Esto es lo que tengo en el viewDidLoad
en el archivo .m
@implementation NeighborProfileViewController
@synthesize uid;
@synthesize profPic;
@synthesize buzz;
@synthesize text;
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
NSURL *url = //some URL to the picture;
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[[UIImage alloc] initWithData:data] autorelease];
self.profPic = [[UIImageView alloc] initWithImage: img];
}
Creo Telegrafié el UIImageView
través IB
correctamente. Tengo una salida del UIImageView
al profPic en el propietario de archivos. ¿Qué estoy haciendo mal?
Me estaba dando vueltas durante unas horas. estaba asignando la imagen vista de nuevo antes de configurar la imagen. Gracias @thelaws – sErVerdevIL