View Single Post
Old 11-14-2008, 11:52 AM   #5 (permalink)
Diskordia
Junior Member
Default Avatar
 
Join Date: Oct 2008
Posts: 14
Default

Quote:
Originally Posted by Nickel View Post
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?:
Code:

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
Code:

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
Code:

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:
Code:

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";
}
Diskordia is offline   Reply With Quote