I'm trying to load a launch image from the Image.xcassets folder but to no avail. There are other answers (and this one) on SO that purport to answer it but their main solution, to simply load an image like so
UIImage *image = [UIImage imageNamed:@"Default@2x"];
returns nil for me.
The filename is named correctly and the project is setup to use the assets.
Does anyone have any idea how I do this or what I could be doing wrong?
Thanks in advance.
EDIT:
EDIT 2: my final code:
-(void) loadSplashImage{
if ([self isiPad]){
self.imageViewSplash.image = [UIImage imageNamed:@"Default-Portrait"];
}
else{
if (self.view.frame.size.height == 480){
self.imageViewSplash.image = [UIImage imageNamed:@"Default"];
}
else if (self.view.frame.size.height == 568){
self.imageViewSplash.image = [UIImage imageNamed:@"Default-568h"];
}
else if (self.view.frame.size.height == 667){
self.imageViewSplash.image = [UIImage imageNamed:@"Default-667h"];
}
}
}
Please note it works for Portrait only.