Add subview to a xib file
I'm trying to add a label to a UIView in a xib file. When I run the app, the label doesn't shows up. - (void)viewDidLoad { [super viewDidLoad]; self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 50, 200)]; [self.label setText:@"This is a label"]; xibView *myxibView = [[xibView alloc] init]; [myxibView.myView addSubview:self.label]; } 1.If your controller has the same name with your xib, For example,XibViewController.m & XibViewController.xib. Your controller will set its view to an instance of XibViewController.xib by default. On this condition, you just need to add the label to the