for some reason i am subclassing navigatioController to overwrite the pushViewController-method:
-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
NSLog(@"Pushing %@ to NavigationController", viewController);
if([[self viewControllers] containsObject:viewController])
{
if( [self topViewController] == viewController )
{
NSLog(@"Pushed ViewController is already on top!");
}
else
{
NSLog(@"Moving Pushed ViewController to top!");
[self popToViewController:viewController animated:animated];
}
}
else
{
[super pushViewController:viewController animated:animated];
}
NSLog(@"NavigationControllers: %@", [self viewControllers]);
}
Everythings working, but whenever i have a line of code, where a viewcontroller gets pushed to the navigationController i get a warning:
Incompatible pointer types sending 'NMROViewController *' to parameter of type 'UIViewController *'
This is a little bit "disturbing". Ok, the method signature expects a UIVIewController, but it's the "original" just overwritten with my code.
I suppose, there must be something, i do not know to "supress" or "avoid" the warning.
Or do i have to generate more than one method!?
Kind regards in advance...