I'm having difficulty in passing current selected row of TableView
to other ViewController
? How to do that easily?
Here's my didSelectRowAtIndexPath
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
WishlistItem *wish = [self.wishlistItem objectAtIndex:indexPath.row];
// Pass these data to DetailViewController
NSLog(@"Wish Item: %@", wish.wishlistItem);
NSLog(@"Description: %@", wish.descWishItem);
NSLog(@"Target Date: %@", wish.targetDate);
}
How would I pass these data to my DetailViewController which has
@property (strong, nonatomic) IBOutlet UILabel *wishLabel;
@property (strong, nonatomic) IBOutlet UITextView *descriptionTextView;
@property (strong, nonatomic) IBOutlet UILabel *detailTargetDate;
I would like to know also how to go to DetailViewController
when row was pressed.
That's all. TIA. Please let me know if I need to provide more info about my question. Thanks.