To use presentModalViewController you have to use it from a UIViewController class, or subclass:
For example:
//RootViewController.m
[self.navigationController presentModalViewController:loginRegView animated:YES];
You can way around this problem by defining a navigation controller into your app delegate:
//yourApp_comAppDelegate.h
UINavigationController *nav;
...
@property(nonatomic,retain) UINavigationController *nav;
and synthesize it
@syntetize nav;
To use presentModalViewController you have to use it from a UIViewController class, or subclass:
For example:
//RootViewController.m
[self.navigationController presentModalViewController:loginRegView animated:YES];
You can way around this problem by defining a navigation controller into your app delegate:
//yourApp_comAppDelegate.h
UINavigationController *nav;
...
@property(nonatomic,retain) UINavigationController *nav;
synthesize it
//yourApp_comAppDelegate.m
@synthesize nav;
and now you can use the method:
//yourApp_comAppDelegate.m
[nav presentModalViewController:yourView animated:YES];
but, first you have to assign it somewhere, i will do it in the RootViewController
//RootViewController.m
- (void)viewDidLoad {
[super viewDidLoad];
app = (yourApp_comAppDelegate *) [[UIApplication sharedApplication] delegate];
app.nav = self.navigationController
}
It should work, let me know :)