Quote:
Originally Posted by Nickel
Thanks for the response. So I made a UILabelController.
Do I keep the display outlet in my main or put it in Label Controller?
What do I connect the display outlet to?
Is this code right?:
You must Login or Register to view and contribute code! This is done to increase participation in helping one another out, if you have been helped please pass on the favor.
[display setStringValue:@"Hello World"];
Or what should I change.
Thanks.
|
I guess you have an UILabel outlet
You must Login or Register to view and contribute code! This is done to increase participation in helping one another out, if you have been helped please pass on the favor.
IBOutlet UILabel display;
and you connected it in the IB with the label.
Than you defineed an IBAction
You must Login or Register to view and contribute code! This is done to increase participation in helping one another out, if you have been helped please pass on the favor.
- (IBAction)buttonPressed:(id)sender;
and also connect it in the IB with the button.
If you have not done that, you can set the text in the display variable as often as you want, it will not have any effect!
If you did everything right, you have an implementation of the IBAction which might look like following:
You must Login or Register to view and contribute code! This is done to increase participation in helping one another out, if you have been helped please pass on the favor.
- (IBAction)buttonPressed:(id)sender {
display.text = @"Hello World";
}