In my application, there is one button in the navigation bar. I want it to work only for the 1t click of the user. If he continousally presses on it 2 or 3 times just after the 1st click the button shouldnt recieve the following ones. How can I do this?
My app always crashes if the user presses it for more than once. I dont want to make it multithread and use lock. Thats why i want to know whether there is anyother alternative.
(If the app crashes by pressing more than once then there’s a bigger problem.)
Since the button is on the navigation bar, that’s a UIBarButtonItem, not a UIButton. The UIBarButtonItem has an
enabledproperty which you can set to NO to disable the button.(If it is really a UIButton, don’t worry, it also has an
enabledproperty.)