What’s the difference between:
myBarButtonItem.enabled = NO;
and
myBarButtonItem.userInteractionEnabled = NO;
Does the button become gray each time?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From the apple documentation uibarbuttonitem does not posses userInteractionEnabled property.Since it inherits from UIBarItem Class Reference it also does not have userInteractionEnabled property.
And also if you use this line
myBarButtonItem.userInteractionEnabled = NO;your app will crash.
If you dont want your button to get pressed use this:-
myBarButtonItem.enabled = NO;Also see apple documentation.
For the regular Button:-
myButton.userInteractionEnabled = NO; will cause no effect in your image image and you can not press it also.
myButton.enabled = NO; will cause the shadow to come on your button image and you can not press it also.