StoryboardでSegue(ShowADVDetail)を使用して、TableViewControllerセルからDetailViewContoller(UITableViewController)にデータを渡したいとします。segueでデータを別のDetailTableViewControllerに渡す際の問題
私はパースされたRSSフィードを含むNSMutableArray 'stories'を持っています。私は、セルの「タイトル」値を渡し、次のprepareForSegueを、使用しています
:私は、特定のセルの「タイトル」の値を渡すことができます次の行で
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"ShowADVDetail"]) {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1];
NSString *theTitle = [[stories objectAtIndex: storyIndex] objectForKey: @"title"];
[[segue destinationViewController] setDetailItem:theTitle];
}
}
。
NSString *theTitle = [[stories objectAtIndex: storyIndex] objectForKey: @"title"];
私もそうLIKE「説明」値と「リンク」の値にアクセスすることができます
NSString *theDescription = [[stories objectAtIndex: storyIndex] objectForKey: @"description"];
NSString *theLink = [[stories objectAtIndex: storyIndex] objectForKey: @"link"];
をしかし、どのように私は私のセグエにすべての3つの値を渡すことができますか?私は右のあなたの質問を理解していると思う。..
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:NO]
[self performSegueWithIdentifier:@"ShowADVDetail" sender:self];
}
・ホープ、このメイクセンス
おかげ
グレートの小切手を追加することができます。それが助けになりました。 – user1297842