我想将数据从 TableView 传递给 anotherViewController。但我不知道如何传递数据。这是我的代码。
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
PeripheralManager * objSelectedDevice=[device objectAtIndex:indexPath.row];
// [self prepareForSegue:@"TableDetails" sender:objSelectedDevice];
// detailViewObject.objCurrentDevice=objSelectedDevice;
}
-(void) prepareForSegue:(UIStoryboardSegue *)segue selectedDevice:(PeripheralManager *)pobjSelectedDevice sender:(id)sender
{
if ([segue.identifier isEqualToString:@"TableDetails"]) {
MeBleDetailViewController *detailViewObject=segue.destinationViewController;
detailViewObject.dataArray=device;
detailViewObject.title=@"Supported Services";
detailViewObject.objCurrentDevice=pobjSelectedDevice;
}
}