Im trying to load an UIImageView into a view, but it wont appear. Any idea why?
Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
// 1. Create View
CGSize screenSize = [UIScreen mainScreen].bounds.size;
CGRect screenBounds = CGRectMake(0, 0, screenSize.width, screenSize.height);
UIView *introView = [[UIView alloc] initWithFrame:screenBounds];
// 2. Show View
[window addSubview:introView]; // window is a UIWindow-object in the applicationdelegate
// 3. Create UIImage and add to View
UIImageView *introAnimation = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 30.0f, 30.0f)];
NSArray *animationBeginning = [NSArray arrayWithObjects:
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"icon_no_sound_white_34.png" ofType:@"png"]],
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"icon_sound_white_34.png" ofType:@"png"]], nil];
introAnimation.animationImages = animationBeginning;
introAnimation.animationDuration = 2.0;
introAnimation.animationRepeatCount = 0;
[introView addSubview:introAnimation];
[animationBeginning release];
animationBeginning = nil;
// start
[introAnimation startAnimating];
}