的对象我已创建从UIViewController类衍生比较实例或相同UIViewController类
_masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController_iPhone" bundle:nil];
// second instance with same class and duplicate nib view
_favItemMasterVC = [[MasterViewController alloc] initWithNibName:@"favMasterViewController_iPhone" bundle:nil];
两者MasterViewController_iPhone & favMasterViewController_iPhone视图是相同一个MasterViewController的两个实例。 现在我想检查当前选择哪个UIViewController(例如:在tabbar上)。 我如何找到两个对象之间的区别?
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
if ([viewController isKindOfClass:[_favItemListMasterVC class]] { // it is always called in both cases}
isMemberOfClass://也没有工作
如何检查有什么区别?
谢谢,它的工作。 :) – HDdeveloper