Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 602
tomanc Avatar asked Dec 20 '13 19:12

tomanc


2 Answers

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"

like image 157
M.Ali El-Sayed Avatar answered Nov 03 '22 01:11

M.Ali El-Sayed


I bet the use auto layout flag is checked for your storyboard by accident. Open your storyboard file, select the file inspector, and make absolutely sure that the "Use Autolayout" checkbox is NOT checked.

like image 1
Duncan C Avatar answered Nov 02 '22 23:11

Duncan C