UIViewController クラスから派生した MasterViewController の 2 つのインスタンスを作成しました
_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 の両方のビューは同じです。ここで、どの UIViewController が現在選択されているか (例: タブバー上) を確認したいと思います。両方のオブジェクトの違いを見つけるにはどうすればよいですか?
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
if ([viewController isKindOfClass:[_favItemListMasterVC class]]
{ // it is always called in both cases}
isMemberOfClass: // も機能していません
違いを確認するには?