How can we disable the button in my iphone application?
My application has one button in the navigation bar. I want it to work for only 1 user click. If he continuously clicks on it 2 or 3 times immediately after the first click, the button should not receive the next. How can i do this?
My app always crashes if the user taps it more than once. I don't want to make it multithreaded and use blocking. This is why I want to know if there is another alternative.
a source to share
(If the app crashes by clicking more than once, it's a big problem.)
Since the button is on the navigation bar, it is a UIBarButtonItem, not a UIButton. UIBarButtonItem has a enabled
property that you can set to NO to disable the button.
(If it really is a UIButton, don't worry, it also has a enabled
property .)
a source to share