我这样呈现视图控制器:
FBViewController *fbViewController =[[FBViewController alloc] initWithNibName:@"FBViewController" bundle:nil];
fbViewController.label.text=@"hello"; // I set the value of the property label which is the outlet
[self presentModalViewController:fbViewController animated:YES];
FBViewController.h:
#import <UIKit/UIKit.h>
@interface FBViewController : UIViewController
@property (weak, nonatomic) IBOutlet UILabel *label;
@end
FBViewController.m:
...
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"%@", self.label.text); // Here instead of "hello" i get the value which was in nib file.
}
...
问题是如何设置标签的值?