I really try my best, but can't figure out what is going on in my code. I did a lot of searching, but I think I just don’t understand some of the objective basics c);
My first question is related to the code below:
[window addSubview:tabBarController.view];
UIImage *image = [UIImage imageNamed:@"lol.png"];
UIImageView *defaultImage = [[UIImageView alloc] initWithImage:image];
Does it make a difference:
[window addSubview:defaultImage]
or that:
[tabBarController.view addSubview:defaultImage]
My second question is about creating a screensaver. I tried to do it myself, but I just can’t figure out what’s not working (we are in appDelegate):
[window addSubview:tabBarController.view];
UIImage *image = [UIImage imageNamed:@"lol.png"];
UIImageView *defaultImage = [[UIImageView alloc] initWithImage:image];
[window addSubview:defaultImage];
[window makeKeyAndVisible];
UIImage *image2 = [UIImage imageNamed:@"lol2.png"];
UIImageView *pubImage = [[UIImageView alloc] initWithImage:image2];
[UIView setAnimationDelegate:self];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:YES];
[defaultImage removeFromSuperview];
[window addSubview:pubImage];
[UIView commitAnimations];
Hmm, I think, as I called "makekeyandvisible" the window should be visible, and the animation should be displayed to users ...
Well, I skipped a step since it does not work: D.
Help greet
Gauthier.
gotye source
share