Sunday, 11 August 2013

Getting a line from one implementation file to another

Getting a line from one implementation file to another

I have researched this and cant seem to find the right keywords to type
in. But anyway I want to be able to use a line in my (1)header file and
use it in (2)implementation file.
So for a rough example lets say I have two ViewController, one named
labelViewController and the other named receiverViewController.
In the labelViewController.h file I would have something like this
#import <UIKit/UIKit.h>
@interface labelViewController : UIViewController {
UILabel *label;
}
@end
Then I want to be able to use this label in a different view controller
like this.
#import "ReceiverViewController.h"
@interface ReceiverViewController ()
@end
@implementation ReceiverViewController
- (void)viewDidLoad
{
label.text = @"Hello World";
}
How could I make this work?



Edit
What would also work would be making a string in the receiveViewController
and sending it to the labelViewController.



Edit 2
What I am trying to do is set the title of a tableViewCell by the
selection in a picker. I used a label to keep it more simple

No comments:

Post a Comment