画面に表示されているView Controllerが「PrimaryViewController」である場合にアラートを表示しようとしていますが、View Controllerの名前を取得してNSStringに変換する方法が正確にわかりません...どんな助けも非常に高く評価されます! !!
//get name of current view controller
UIViewController *currentVC = self.navigationController.visibleViewController;
if ([currentVC isEqualToString:@"PrimaryViewController"])
{
//display name of current view controller in alert
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Your current view controller:" message:currentVC delegate:nil
cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}