I created a view in xib (with an activity indicator, a progress view and a label). Then I created .h / .m files:
In IB, I set the file owner and viewed it in MyCustomView and connected the IBOutlet to the file owner
In MyViewController.m I have:
- (void)viewDidLoad { [super viewDidLoad]; UIView *subView = [[MyCustomView alloc] initWithFrame:myTableView.frame]; [subView setBackgroundColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.5]]; [myTableView addSubview:subView]; [subView release]; }
When I launch the application, the view is added, but I do not see the label, progress bar and activity indicator.
What am I doing wrong?
ios objective-c xib addsubview
Sefran2 Mar 18 2018-11-18T00: 00Z
source share