I´m trying to display a UITableView as a subview of a UIView.
When I trigger the action below, the view is shown but contain no data.
- (IBAction)youwin
{
UITableView *HSView = [[UITableView alloc] initWithFrame:CGRectMake(200,200,500,600)] ;
[self.view addSubview:HSView];
}
It looks like the code in the HSView.m file is not triggerd.
The HSView.h is imported into the main controller.
What am I missing?
Few problems in your code are :–
UITableView, you need to set thedelegateanddataSourceproperties for the it to work properly.dataSourceobject is the one that provides the content and without it you will get an empty table view.HSView.hso I am thinkingHSViewis a class. In that caseUITableView *HSViewis incorrect. If you wanted to instantiateHSViewthen doHSView * hsView = .... If it is a subclass ofUITableView, point 2 will hold for it too.