I have an image view and I am trying to change image of imageview everytime the orientation changes but the image is not changing can anybody help me on this
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (!mainBackgroundImageView) {
mainBackgroundImageView=[[UIImageView alloc] init];
}
if (interfaceOrientation==UIInterfaceOrientationPortrait || interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown) {
UIImage *tempImage=[UIImage imageNamed:@"dart-login-image.png"];
[mainBackgroundImageView setImage:tempImage];
[tempImage release];
}
else {
[mainBackgroundImageView setImage:[UIImage imageNamed:@"background-and-header-integerated.png"]];
}
return YES;
}