-1

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...

Micha El
  • 73
  • 1
  • 8
  • I tried your code, and I got no warnings when pushing a subclassed view controller. What code are you using to do the push? – rdelmar Jul 28 '13 at 15:14
  • You may call me an idiot :-( While lookinmg for an example, i discovered that the same view-instance once generates the error and onces not, due due a missing import of the corresponding .h-file SORRY... problem in front of the screen – Micha El Jul 28 '13 at 15:24

1 Answers1

-1

Ok, Solution as simple as that. I forgot to import the correct .h-files at the beginning

Micha El
  • 73
  • 1
  • 8