I need to check which UIViewController is active so I have implemented some cases depending upon the result.
[self.navigationController.visibleViewController className]
This always returns null.
I am checking with this statement:
if([iDetailController isKindOfClass:[IDetailController class]])
but it fails, kindly help me if I am doing something wrong here.
Use the following method:
if ([self isMemberOfClass:[IDetailController class]]){
CFShow(@"Yep, it's the IDetailController controller");}
isMemberOfClass tells you if the instance is an exact instance of that class. There’s also isKindOfClass:
if ([self isKindOfClass:[BaseView class]]){
}isKind tests that the class is a extension of a certain class.