UIImageView shows in storyboard but doesn't show up in simulator

tomanc picture tomanc · Dec 20, 2013 · Viewed 9.3k times · Source

I added images using uiimageview in storyboard and connected them to iboutlets and they are not showing up in the simulator. I don't think they are off screen since they are very close to other images and I have auto layout off as i saw in other threads that may be a problem. This is some code if it may help. None of the hearts will show up in simulator.

EDIT: I just moved one of the other images to the center of the screen and when I clean/build/run nothing changed in the simulator. So for some reason anything I change in storyboard is not being carried over into simulator. It all worked last night and I'm not sure what could have change to this afternoon.

#import <UIKit/UIKit.h>

float LeftMovement;
float RightMovement;
float UpMovement;
int life = 3;

@interface Game : UIViewController
{
    IBOutlet UIButton *Start;
    IBOutlet UIImageView *Runner;
    IBOutlet UIImageView *Water;
    IBOutlet UIImageView *Heart1;
    IBOutlet UIImageView *Heart2;
    IBOutlet UIImageView *Heart3;
    IBOutlet UILabel *Lives;

    NSTimer *Movement;


}

-(IBAction)StartGame:(id)sender;
-(void)Moving;
-(void)Walk;
@end

Answer

M.Ali El-Sayed picture M.Ali El-Sayed · Aug 31, 2014

i came up late but the right answer is

Right click on the image in Xcode, go to File Inspector, i had to check the checkbox under "Target Membership"