【问题标题】:set value on label of child view from parent view从父视图设置子视图标签的值
【发布时间】:2014-05-10 10:06:01
【问题描述】:

我一直在将值从父视图设置到创建子对象的子视图。如下:

-(void)pushView  
{  
  spikeyDetectionAddDrugVC *myVC = [[spikeyDetectionAddDrugVC alloc] initWithNibName:@"spikeyDetectionAddDrugVC" bundle:nil];
[self.navigationController pushViewController:myVC animated:YES]; 
  myVC.lblHeaderTitle.Text = @"From here";  
}  

下面这行:

myVC.lblHeaderTitle.Text = @"From here";

不起作用。 除非我们转发某些视图对象,否则它不会在子视图上设置文本。

有什么新方法可以在 ios7 中设置吗?

谢谢。

【问题讨论】:

    标签: ios uilabel


    【解决方案1】:

    您的代码甚至不是 Objective-C。发送给对象的消息用方括号括起来。该语言区分大小写,因此您必须使用UILabe 的正确属性,即text,而不是Text

    【讨论】:

    • 是的,我知道我刚刚写了 sudo 代码来问这个问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多