I have a UIView which contains a UITableView. The tableview\'s delegate is set to my UIView, but it never calls the delegate methods:
-(id)init {
self = [sup
Can you please write the code that you have written on your cellForRowAtIndexPath: method? Because i can't find anything wrong with your code.
Are you calling your UIView from some other ViewController? If yes, how?
I have done something like this once. I declared a method in the UIView like this :
- (void)setUpTableView{
self.tableview.delegate=self;
self.tableview.dataSource=self;
}
And then i called the setUpTableView from the view controller i added this view to, like this :
[self.yourView setUpTableView];
This might help. Thanks.
You do not need to use a UIViewController, that's just a smokescreen. You also do not need to add to the .h, although you should do that anyway because Xcode will complain otherwise, and you won't get method name auto complete.
I just wrote a test project that embeds a table view in a normal UIView and it works fine. Just make sure your initialization code is being called. I bet you need to move it to awakeFromNib.