Hi everyone,
For some reason, my app crashes every time I try to dismiss a modal view controller. I have been through all my code and cannot find a reason for this (I even re-checked the Apple documentation to make sure that I wasn't missing anything), so I'll post it in the hope one of you may find the problem:
Code:
//IN MY MAIN VIEW CONTROLLER HEADER FILE
#import "GameOverViewController.h"
@interface JumpViewController : UIViewController <GameOverViewControllerDelegate>...
//IN MY MAIN VIEW CONTROLLER IMPLEMENTATION FILE
-(void)gameOverViewControllerDidFinish:(GameOverViewController *)viewController {
[self dismissModalViewControllerAnimated:YES];
}
//IN MY GameOverViewController HEADER FILE
@interface GameOverViewController : UIViewController {
id <GameOverViewControllerDelegate> delegate; }
@property (nonatomic, assign) id <GameOverViewControllerDelegate> delegate;
@end
@protocol GameOverViewControllerDelegate
-(void) gameOverViewControllerDidFinish:(GameOverViewController *)viewController;
@end
//IN MY GameOverViewController IMPLEMENTATION FILE
-(IBAction)dismiss {
[self.delegate gameOverViewControllerDidFinish:self];
}
I am sorry if the problem is something simple I have missed, but I have checked and re-checked it and can find nothing wrong :S
Thanks
Cam