I have intreface:
@interface Box : CDVPlugin <UITableViewDataSource, UITableViewDelegate, UISearchDisplayDelegate>
Now after an event I want to display tableView with diffrent kind of data.
I created a tableView and adde it…its working
UITableView *tView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 150, 150)];
[[self.webView superview] addSubview:tView];
How can I connect it do a dataSource??
I tried adding:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
but it’s never stops there and the table is always empty.
How to coonect it to data (NSMutableArray)?
You’re never telling the table View who’s the dataSource
You can do it like this:
DataSource is for the creation of the cells (cellForRowAtIndex:, numberOfRowsInSection:, etc)
Delegate is for actions, like (didSelectRowAtIndexPath:)