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

mandude

macrumors member
Original poster
Nov 19, 2009
64
0
hi i have a simple UIButton named "button" with the IBAction "show" connected to it. I want it to be that when the user taps this button, nothing happens, but when the user taps it one more time, then the label magically appears. The user may tap the button once, and an hour later tap it again, and the label will only appear when the user taps the button "button" the second time. Here's the code:



h. file:

@interface PlayingCampeignViewController : UIViewController {

UILabel *label;
UIButton *button;
NSUInteger *number;
}

@property (nonatomic, retain) IBOutlet UILabel *label;
@property (nonatomic, retain) IBOutlet UIButton *button;
-(IBAction)show;
@end

m. file:

-(void)viewDidLoad {
number = 0;
}

-(IBAction)show {
number = number + 1;
if (number == 2) {
label.hidden = NO;
}
 
Are you uaecacher in disguise?

Would you use the code tags?

What's the question?

Change this

Code:
NSUInteger *number;

to this

Code:
NSUInteger number;
 
hey thanks for the response... and ya i did that yet instead of my error before it now quits the first time i press the UIButton : P any more help and i would love you.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.