I am trying to create a UITableView that has one row per section to give the look of a message chat table. How would one achieve this? Using
[array count]
In different combinations in the two delegate methods below either return separate sections of the same cell or multiple rows in each section.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [array count];}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1;}
That looks like it should do what you want. Then you need to use the section property from the index path instead of the row when picking out an array element in
cellForRowAtIndexPath:.