我用firstclassViewController和secondclassViewController创建了两个类名,在我的secondclassViewControllerUIlabel
类中, 我想访问firstclassViewController并且我想将它的值更改UILabel
为新值。
这是我的代码片段,
firstclassViewController.h
@property (strong, nonatomic) UILabel *navLabel;
第一类视图控制器.m
navLabel = [[UILabel alloc] initWithFrame:CGRectMake(70,7,180,30)];
navLabel.text = @"Categories";
navLabel.font = [UIFont boldSystemFontOfSize:16.0f];
navLabel.textColor = [UIColor blackColor];
navLabel.backgroundColor = [UIColor clearColor];
navLabel.textAlignment = UITextAlignmentCenter;
[[self.navigationController navigationBar] addSubview:navLabel];
secondclassViewController.m
firstclassViewController.m *Obj=[[firstclassViewController.m alloc] initWithNibName:@"firstclassViewController.m" bundle:nil];
Obj.navLabel.text=@"New Value";
但我无法改变我对 UILabel 的价值..
任何帮助都会得到帮助。