Not Updating Right

Ok, I’m making an app for iPhone that lets you drag three sliders and view the created RGB Value. For the moment, I’m just making it control each slider’s label (here’s my layout:

RGB Color Viewer (eventually this will be in the overall color)

Red Value (supposed to be {Value of slider, 0, 0} )
Slider (from 0 to 1)

Green Value (supposed to be {0, Value of slider, 0} )
Slider (from 0 to 1)

Blue Value (supposed to be {0, 0, Value of slider} )
Slider (from 0 to 1)

Ok, here’s my header’s interface code: (the .h file)
@interface RGB_ColorsViewController : UIViewController {
IBOutlet UISlider *redSlider;
IBOutlet UISlider *greenSlider;
IBOutlet UISlider *blueSlider;
IBOutlet UILabel *redLabel;
IBOutlet UILabel *greenLabel;
IBOutlet UILabel *blueLabel;

}
-(IBAction)updateredLabel:(id)sender;
-(IBAction)updategreenLabel:(id)sender;
-(IBAction)updateblueLabel:(id)sender;

@end

And in my main file I have this: (the .m file)

@implementation RGB_ColorsViewController

-(IBAction)updateredLabel:(id)sender {
redLabel.textColor = [UIColor colorWithRed:[@“%.0f” floatValue]/255 green:0 blue:0 alpha:1.0];
}
-(IBAction)updategreenLabel:(id)sender {
greenLabel.textColor = [UIColor colorWithRed:0 green:[@“%.0f” floatValue]/255 blue:0 alpha:1.0];
}
-(IBAction)updateblueLabel:(id)sender {
blueLabel.textColor = [UIColor colorWithRed:0 green:0 blue:[@“%.0f” floatValue]/255 alpha:1.0];
}

And then it continues with the normal stuff. So how do I link the buttons and slider I made in the .xib file to the redLabel, blueLabel etc. variables I declared in my other files? This is my first app so be nice :slight_smile: Lol, thanks people!

I don’t want this to sound rude (sorry), but this is basic and you should be able to find this info online easily or in the documentation. There are ample demos on how to start you first iApp or Mac App and use Interface Builder. In IB, you right click on your apps delegate or main class (blue cube). The grey floating window shows up with all your declared UI elements/outlets. Then drag from the empty dot next to an item name, over to the layout view, and release over top of the item. To link a button to perform your method, control-drag from the button to the class (blue cube) and then a list of actions will appear and pick the method to perform.

Where is this blue cube? Here’s the screen I see now, what do I click to see the cube:
And yeah, I know it’s a dumb question, thanks for answering anyway though :slight_smile:

Ok, just right clicking on the blue box around the screen of my app worked, thanks, so I ran it (with all the things linked) but whenever the colors where updated, that text went black, instead of a shade of red, green, or blue, do you know why? I made it so the colors update whenever the slider value changes. So theyre all red green and blue, then I drag the red slider and the red label turns black. Thanks again! Sorry for being dumb again! Lol