У меня есть ViewController, «ViewController A», и я хотел бы нажать на другой ViewController, «ViewController B».Когда я нажимаю на ViewController B, я проверю валидацию пользователя и выведу всплывающее предупреждение, если пользователь не является действительным пользователем.
Как я могу скрыть UINavigationBar, так как мой текущий код не работает должным образом.Пожалуйста помоги.Спасибо!
ViewController A
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if(indexPath.row==0) //Wishlist
{
WishList_ViewController *WishList_ViewControl = [[WishList_ViewController alloc]init];
// [self cw_presentViewController:WishList_ViewControl];
[self cw_pushViewController:WishList_ViewControl];
}
}
ViewController B
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"My Wishlist";
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"isLogin"])
{
//THIS CODE DOES NOT WORKING
[self.navigationController setNavigationBarHidden:YES animated:YES];
//Check whether is login or not
SCLAlertView *alert = [[SCLAlertView alloc] init];
[alert addButton:@"Done" target:self selector:@selector(btnLoginClick:)];
alert.customViewColor = ThemeBlueColor;
[alert showWaiting:self title:@"Login" subTitle:@"Please login to view your wishlist"
closeButtonTitle:nil duration:2.0f ];
[alert alertIsDismissed:^{
[self btnLoginClick:nil];
}];
}
}
Текущий результат: