I am creating a side menu in a table view that has custom UITableViewCell’s.
I have created a reusable cell which is used in the following:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
LeftMenuTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray* views = [[NSBundle mainBundle] loadNibNamed:@"LeftMenuTableViewCell" owner:nil options:nil];
for (UIView *view in views) {
if([view isKindOfClass:[UITableViewCell class]])
{
cell = (LeftMenuTableViewCell*)view;
[cell.displayName setText:[NSString stringWithFormat:@"Cell 1"];
}
}
}
return cell;
}
I would like to know how to create other cells for this table. The table will be like a Facebook/Path side Menu. For example
My Profile
Settings
Help
Logout
Each would have the same design, although different text for the label and for the icon next to it. Also would load a different view controller on the right. Can someone explain how this is accomplished? Or provide a link to any tutorial which explains making a custom table view with multiple different cells, would I need to duplicate the cell .h, .m and NIB file and create each custom UITabelViewCell separately?
Use the same cell class and put it as(Since there are no design change to cell and only text and images are changing),
In
didSelectRowAtIndexPathmethod,This should work for you right?