I create a class from a string, verify that it is valid, and then check to see if it matches a particular method. If so, I call the method. Everything works fine, except that I get an annoying compiler warning: "warning: no" -setCurrentID: "method found". Am I something wrong here? Do I need to tell the compiler everything is okay and prevent it from reporting a warning?
Here is the code:
id viewController = [[NSClassFromString(class) alloc] init];
if ([viewController respondsToSelector:@selector(setCurrentID:)])
{
[viewController setCurrentID:itemID];
}
[self.navigationController pushViewController:viewController animated:YES];
[viewController release];
Greetings
Dave
source
share