views:

1035

answers:

3

Hi All,

I am using UITextView to edit text. I want to use two buttons Edit and Save. Initially i want to show edit button, when the user click on edit i want to show save button. when the content successfully saved i dont want to show save button any more.

I am a c# coder, in c# i used to do like this

C# code
btnedit.visible=true;

Now i want to know how to make a button visible and not visible from objective c code.

Thanks,

+3  A: 

Since UIButton inherits from UIView, you can just set the hidden property on the button (via UIButton doc)

button.hidden = YES;
Benny Wong
+1  A: 

Instead of visible, the property you are looking for is hidden.

saveButton.hidden = YES;

That should do the trick.

Hector Ramos
+2  A: 

Consider enabling or disabling the buttons instead. You get the same end result, but it's a little bit more consistent since things aren't appearing and dissapearing out of nowhere.

Marc Charbonneau
From a UI perspective, this definitely seems nicer
Benny Wong