EXC_BAD_ACCESS Error
Hey Guys,
This is my first app/objective-c experiment, so bare with me...
I'm trying to start small. All I have so far is the app loading, serving up a view with a button. When the user clicks that button they are taken to view two, which has a "back" button, that is intended to do the reverse. The first button animates in the second view perfect, but the "back" button crashes the app and serves up the "EXC_BAD_ACCESS" error.
Here is the code:
From the SetupViewController button:
- (IBAction)BtnRequestSetup:(id)sender {
RequestSetupView *page = [[RequestSetupViewalloc] initWithNibName:@"RequestSetupView"bundle:nil];
CGRect theFrame = page.view.frame;
theFrame.origin = CGPointMake(self.view.frame.size.width, 0);
page.view.frame = theFrame;
theFrame.origin = CGPointMake(0,0);
[UIViewbeginAnimations:nilcontext:nil];
[UIViewsetAnimationDuration:0.8f];
page.view.frame = theFrame;
[UIViewcommitAnimations];
[self.view addSubview:page.view];
[page release];
}
From the RequestSetupView "back" button (this is what throws the error - when I click the button)
- (IBAction)BtnBacktoSetup:(id)sender {
SetupViewController *page2 = [[SetupViewControlleralloc] initWithNibName:@"SetupViewController"bundle:nil];
CGRect theFrame2 = page2.view.frame;
theFrame2.origin = CGPointMake(self.view.frame.size.width, 0);
page2.view.frame = theFrame2;
theFrame2.origin = CGPointMake(0,0);
[UIViewbeginAnimations:nilcontext:nil];
[UIViewsetAnimationDuration:0.8f];
page2.view.frame = theFrame2;
[UIViewcommitAnimations];
[self.view addSubview:page2.view];
}
Let me know if you need more to clarify. Thanks in advance.