First of all i am a n00b. After long time of trying and research i decided to get some external help.
My Project:
i made a book for children. After i analyzed the code I got rid of all potential leaks, but still i have a Level=1+2 crash. with testing my app i figured out that my animations could be the probleme because after flipping through the book and watching around 30 animations it crashes.
Did i forget to release something?
maybe you see something i don´t see.
Here is my Code
- (void)addButton1 {
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
[button1 setFrame:CGRectMake(174, 100, 421, 250)];
[button1 setBackgroundImage:[UIImage imageNamed:@"button.png"]
forState:UIControlStateNormal];
[button1 addTarget:self action:@selector(buttonPressed1)
forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button1];
}
- (void)animieren1:(UIImageView *)image {
[self animationZustand1];
[UIView commitAnimations];
}
- (void)buttonPressed1 {
[self animieren1:self.animation1];
}
- (void)normalZustand2 {
[self.animation2 setImage:[UIImage imageNamed:@"muller3s.png"]];
}
- (void)initAnimation2 {
animation2 = [[UIImageView alloc] initWithFrame:
CGRectMake(173, 550, 422, 262)];
[self normalZustand2];
self.animation2.opaque = YES;
[self.view addSubview:self.animation2];
}
- (void)animationZustand2 {
NSArray *imageArray = [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"muller3s.png"],
[UIImage imageNamed:@"muller4s.png"],
nil];
self.animation2.animationImages = imageArray;
self.animation2.animationDuration = 2.1;
animation2.animationRepeatCount = 1;
[self.animation2 startAnimating];
[self normalZustand2];
[imageArray release];
NSString *path = [[NSBundle mainBundle] pathForResource:@"riesel" ofType:@"mp3"];
AVAudioPlayer* theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL
fileURLWithPath:path] error:NULL];
theAudio.volume = 0.1;
self.audioPlayer3 = theAudio;
[theAudio play];
[theAudio release];
}
Any ideas? It would be really cool if anyone could help me! Thanks in advance Planky