How do I edit an interface builder object programmatically?

Posted by Evelyn on Stack Overflow See other posts from Stack Overflow or by Evelyn
Published on 2009-06-26T15:14:27Z Indexed on 2010/04/05 8:13 UTC
Read the original article Hit count: 359

I created a label using Interface Builder, and now I want to set the background color of the label using code instead of IB's color picker. (I want to do this so that I can define the color using RGB and eventually change the colorspace for the label.)

I'm in cocoa. How do I edit the attributes of an IB object using code?

My code looks like this:

//.h file

#import <UIKit/UIKit.h>

@interface IBAppDelegate : NSObject {

    UILabel  *label;
}

@property (nonatomic, retain) IBOutlet UILabel *label;

@end



//.m file


#import "IBAppDelegate.h"

@implementation IBAppDelegate

@synthesize label;

(memory stuff...)

@end

© Stack Overflow or respective owner

Related posts about interface-builder

Related posts about attributes