The label should be declared as an IBOutlet as Josh said in your .h file as above and yes connect your label in Interface Builder.
You can also define your label as @property in .h file and synthesize it in .m file so that you can easily access "myLabel" using . operator.
Now to update your label with your calculations, simply define the updateLabel function in .h file and write your code to implement update in the implementation file as below:
@interface File1 {
IBOutlet UILabel *myLabel;
}
@property (nonatomic, retain) IBOutlet UILabel *myLabel;
- (void)updateLabel:(id)sender;
@end
@implementation File1
@synthesize myLabel;
- (id)init {
if ( (self = [super init]) ) {
// init custom work here
}
return self;
}
- (void)updateLabel:(id)sender {
//Here sender can be any button who call this function or send it nil if not
//update your label here
myLabel.text = @"Updated Text";
......
}
@end