So, I'm trying to make two kinds of tables in one view, and I have problems. I read another answer on how to do this, but they do not help me.
In my .h file, I made two exits for two views, calling them myFirstViewText and mySecondViewTex
So in my m files for - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
I want to be able to print individual values ββin each individual controller, and I'm not sure because you only return 1 cell?
So far i have done it
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Rx"; static NSString *CellIdentifier2 = @"allergies"; UITableViewCell *cell = [tableView dequeueReusableHeaderFooterViewWithIdentifier:CellIdentifier]; UITableViewCell *cell2 = [tableView dequeueReusableHeaderFooterViewWithIdentifier:CellIdentifier2]; if(!cell){ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } if (!cell2) { cell2 = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier2]; } if (tableView == self.myFirstTextView ) { cell.textLabel.text = @"HI JAZZY";
It prints βI Love Jazzyβ in my first TableView, and nothing prints in the second. Why is this happening and how can I fix it? Thanks: D
source share