I have created a grouped table view in a program and configured it to 1 section and 4 rows, where I pull in a custom cell that I created (UITableViewCell) using a NIB file, as so...
Now, I want to use that "firstlevelcell" throughout my application in different places, but for this view, I want to use it four times in a row, and change the label to four different values I have stored in an array [0-3].
I feel like if I create an outlet, I have to change the class of the UITableViewCell nib from NSObject to my custom subclass to tie it to that outlet...but that would mean I have to create multiple copies of that NIB if I want to use it elsewhere in the application.
How do I change the value of the labels in that custom NIB when I load it, so that I can use that NIB all over the application???
Does that make sense?
Code:
if (indexPath.section == 0)
{
cell = [tableView dequeueReusableCellWithIdentifier:@"firstlevelcell"];
if (!cell)
{
cell = [[[NSBundle mainBundle] loadNibNamed:@"firstlevelcell" owner:self options:nil] lastObject];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
...
Now, I want to use that "firstlevelcell" throughout my application in different places, but for this view, I want to use it four times in a row, and change the label to four different values I have stored in an array [0-3].
I feel like if I create an outlet, I have to change the class of the UITableViewCell nib from NSObject to my custom subclass to tie it to that outlet...but that would mean I have to create multiple copies of that NIB if I want to use it elsewhere in the application.
How do I change the value of the labels in that custom NIB when I load it, so that I can use that NIB all over the application???
Does that make sense?