views:

33

answers:

1

I have a UIImageView in Interface Builder connected to an outlet called imageView. The statement

[imageView setImage: [UIImage imageNamed: @"xxxx.png"]];

displays an image successfully if placed in viewDidLoad, but NOT if placed in an action method in the same view controller. There's an NSLog in the action method so I know it's firing.

I've looked at the other "UIImageView not appearing" questions but none of them seem directly relevant. Any help would be much appreciated!

Thanks,

Mark

+1  A: 

Try forcing a redraw:

[imageView setNeedsDisplay];
Ben
That doesn't seem to help. I should have made clear that even if the setImage statement in viewDidLoad is commented out, the corresponding statement in the action method has no effect. So I don't think it has anything to do with an image already being in the view. - Mark