Tinnin 8 Posting Whiz in Training

Hi All,

I have this code in my tableView;

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    YFRFormViewController *formViewController = [[YFRFormViewController alloc] init];

    NSArray *campaigns = [[YFRCampaigns currentCampaigns] allCampaigns];
    YFRCampaignForm *selectedCampaign = campaigns[indexPath.row];

    // Give formViewController a pointer to the item object in row
    formViewController.campaignForm = selectedCampaign;

    // Push it onto the top of the navigation controller's stack
    [self.navigationController pushViewController:formViewController animated:YES];
}

In the "campaigns" array are objects from classes that have extended YFRCampaignForm.

When I select one I want it to bring up the view data for that object.

At the moment it is being put in a YFRCampaignForm. I assume this means that any added methods/properties etc will not be accessible? But if I don't know what will be picked from the list, how can I know which class link it to?

formViewController.campaignForm is also of type CampaignForm. Ideally this too would be flexible, but this is listed as a property in a different header file.

Does anyone have any suggestions or can tell me where I am going wrong? Or if I'm even doing it right (stranger things have happened)?

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.