I have create a class from a string, check it is valid and then check if it responds to a particular method. If it does then I call the method. It all works fine, except I get an annoying compiler warning: "warning: no '-setCurrentID:' method found". Am I doing something wrong here? Is there anyway to tell the compiler all is ok and stop it reporting a warning?
The here is the code:
// Create an instance of the class
id viewController = [[NSClassFromString(class) alloc] init];
// Check the class supports the methods to set the row and section
if ([viewController respondsToSelector:@selector(setCurrentID:)])
{
[viewController setCurrentID:itemID];
}
// Push the view controller onto the tab bar stack
[self.navigationController pushViewController:viewController animated:YES];
[viewController release];
Cheers
Dave