我在屏幕上有一個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