如何禁用导航的右侧栏按钮 [英] How to disable the right bar button of navigation

查看:139
本文介绍了如何禁用导航的右侧栏按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

self.navigationItem.rightBarButtonItem.enabled = FALSE;
[activityIndicator startAnimating];
//[myview sendSubviewToBack:self.view];
//self.view.hidden= TRUE;
myview.hidden= FALSE;
activityIndicator.hidden= FALSE;
dt = [[DateTime alloc] init];

这是我的方法,当用户点击左侧导航按钮这个方法在这里触发我想要禁用按钮,但它没有禁用,我检查了我的代码我没有在任何地方启用它.......请帮助我

This is my method in this when user click on leftbar button of navigation this method fires here i want to disable the button but its not getting disable and i checked my code i am not enabling it anywhere.......Please help me

推荐答案

如果在Objective-C中未正确初始化属性,您将看不到任何错误,该语句将无法执行..

If properties aren't initialised properly in Objective-C you won't see any errors, the statement just won't get executed..

我的第一个猜测是你在nil引用上调用方法。

My first guess would be that you're calling a method on a nil reference.

使用调试器来查看rightBarButtonItem是否已正确设置。

Use the debugger to see whether the rightBarButtonItem has been set up properly.

这篇关于如何禁用导航的右侧栏按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆