Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iAppleFan08

macrumors newbie
Original poster
Aug 26, 2008
25
0
It sounds simple and most people will probably take one look at this and think "how could you not get this?" but my problem is with simply hiding a button when I click it. The books I'm learning the code out of use many examples of button.hidden = YES; but it's not working in my app.
 

p.luik

macrumors regular
Jan 18, 2008
196
0
Faribault, MN
Could you provide some more code, what language you are coding in, and some more details on your reasoning behind hiding the button?
 

iAppleFan08

macrumors newbie
Original poster
Aug 26, 2008
25
0
All I have for that action so far is

button.hidden = YES;

All I want is to hide the button once it's pressed. That's all I have going so far. I have the outlet, the interface button connected correctly, synthesized, and the action specified. I'm coding in Objective-C.
 

iphonedevelop18

macrumors member
Feb 26, 2009
50
0
if you just want to disable it thats also an option as you can make it dissapear under the disabled design or whatever.

just say

button.enabled = FALSE;

and that will disable it.
 

iAppleFan08

macrumors newbie
Original poster
Aug 26, 2008
25
0
That doesn't seem to work either... :(

Maybe it's something stupid I did that I just can't seem to figure out.
 

iAppleFan08

macrumors newbie
Original poster
Aug 26, 2008
25
0
I'm not getting errors. It builds just fine with no errors or warnings. It just doesn't DO it.
 

NickFalk

macrumors 6502
Jun 9, 2004
347
1
Fairly basic question, but:
Have you hooked up the correct IBOutlet to the button?
 

Gottaa

macrumors newbie
Jan 28, 2009
15
0
As Nick says, is the IB outlet hooked into the interface builder ?

the IBOutlet needs defining in the .h, synthesizing in the .m then you should be able to link it to the button in the interface builder and then button.hidden = YES; will work. I know it works because I did it just this morning :)
 

iAppleFan08

macrumors newbie
Original poster
Aug 26, 2008
25
0
It worked! It was a connecting problem (and something stupidly simple). Thank you for your help! :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.