- Home /
How to create multiple columns in UITableView i.e CustomCellView?
I am just starting iOS development. I am trying to display a multiple columns in UItableview from NSArray? So please help me anyone? I have created one column but i don,t know how to create another column?
I have done the following.
// This is my code
(NSArray *)numbers {
NSArray *col1 = @[@"1", @"2", @"3", @"4", @"5"]; return col1;
} - (NSArray *)numberCodes {
NSArray *col2 = @[@"Roy", @"Ankit", @"Jhon", @"Kem", @"Pawan"];
return col2;
} -(NSInteger)tableView:(UITableView )tableView numberOfRowsInSection:(NSInteger)section { return self.numbers.count; } - (UITableViewCell )tableView:(UITableView )tableView cellForRowAtIndexPath:(NSIndexPath )indexPath {
UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
//cell.textLabel.text = [self.numbers objectAtIndex:indexPath.row];
cell.textLabel.text = [self.numberCodes objectAtIndex:indexPath.row];
return cell;
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612072834im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Fixing Layout issues for iPad 0 Answers
is unity required iphone device ? 1 Answer
How to test with iPad 4.2 Simulator? 1 Answer
iOS development: what hardware for testing? 1 Answer
Possible to render a simple colored spot rather than use a PNG? 0 Answers