Add a property to your detail view controller so you can set the id when you set the detail item. Then:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
self.detailViewController.detailIdentity = _kundnr[indexPath.row];
self.detailViewController.detailItem = _objects[indexPath.row];
}
And then use self.detailIdentity
instead of [self.detailItem tag]
. And, it's already a string so you don't need to convert to integer and back.
You should probably also:
- Rename
detailItem
to be more specific, likedetailDate
- Think about creating a custom class to hold the full
detailItem
(so it contains the identity and the date)