How do I pass an object from the drop-down list of parts to the detail view controller? Are there any recommendations or quick fixes for this? Ideally, I want to create a method like this:
[self performSegueWithIdentifier:@"showDetail" sender:self passObject:object];
The reason is that “segue readiness” seems to be triggered only when pressed, when I click the cell in front of the part disclosure indicator. How to create a method like the one above to create the preparation effects below?
if ([[segue identifier] isEqualToString:@"showDetail"]) { NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; id object = [_objects objectAtIndex:indexPath.row]; [[segue destinationViewController] setDetailItem:object]; }
I already tried to subclass UIStoryboardSegue like this, but ran into two problems.
@implementation masterToDetail -(void)performSegueWithIdentifier:(NSString*)identifier sender:(id)sender passObject:(id)object{ [self.destinationViewController setDetailItem:object]; [self performSegueWithIdentifier:identifier sender:sender]; } -(void)performSegueWithIdentifier:(NSString*)identifier sender:(id)sender{
erran source share