Hi -
I've got an application with several modal view controllers. Most of them work fine except for one that is within a UINavigationController (so that I can show a navbar). When this modal view controller is displayed it animates fine but when dismissed it does not animate. I'd really like it to animate. Any thoughts?
Thanks much!
Here is the modal view controller (I've simplified the code, hopefully not too much!):
@protocol SettingsDelegate;
@interface Settings : UIViewController <UITextFieldDelegate> {
id<SettingsDelegate> delegate;
}
@property (assign) id<SettingsDelegate> delegate;
@end
@protocol SettingsDelegate <NSObject>
@optional
- (void)Settings:(Settings *)controller dismissModalController:(NSString *)foo;
@end
The main routine .h looks like:
#import "Settings.h"
@interface MainPageController : UIViewController <SettingsDelegate> {
}
@end
The main routine .m looks like this:
- (void)Settings:(Settings *)controller dismissModalController:(NSString *)foo {
[self dismissModalViewControllerAnimated:YES];
}
- (void)doSettings {
Settings *addController = [[Settings alloc] initWithNibName:@"Settings" bundle:nil];
addController.delegate = self;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addController];
[self presentModalViewController:navigationController animated:YES];
}