Can I have different configuration of rows in different section of table view?
Can I have different configuration of rows in different section of table view?
This method doesn't 开发者_高级运维contains the section parameter:
-(UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
So is it possible to do differently for different sections in the same table view?
Yes you can have different configuration in different section of view.
Actually indexPath.row will give you row index and indexPath.section will give you section index.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"You are at row = %d and section = %d",indexPath.row,indexPath.section);
}
Depeneding on that two index you can specify different configurations.
Jim.
精彩评论