我在屏幕上有一个UIView
元素。它通过IBOutlet
radioButtonGroupView
连接。我想添加一个子视图到该元素,它不工作。子视图永远不会被添加。无法添加子视图到我的UIView
这里是我的代码:
-(id) initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
UIView *subView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
subView.backgroundColor = [UIColor yellowColor];
[self.radioButtonGroupView addSubview:subView];
return self;
}
因为我的UITableView包含在一个nib文件中。 initWithCoder方法确实被调用,但子视图永远不会被添加。 – 2013-04-23 15:46:15
'radioButtonGroupView'目前为零。 – samfisher 2013-04-23 15:48:04
那么,我认为我应该在视图控制器中做到这一点? – 2013-04-23 15:50:38