タブバーアプリでストーリーボードを使用したRSSリーダードリルダウンテーブルを開発しようとしています。RootTableViewControllerに解析済みのXMLを入力することができました。RootTableViewControllerの各行がポイントし、選択したセルから別のDetailTableViewControllerにデータを渡す方法を理解するのに問題があります。
これは、XMLを解析し、RootTableViewControllerにデータを入力するためのコードの一部です。
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [stories count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"AdvCurrentCelly";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1];
NSString *description = [[stories objectAtIndex: storyIndex] objectForKey: @"description"];
NSString *title = [[stories objectAtIndex: storyIndex] objectForKey: @"title"];
//This populates the prototype cell 'AdvCurrentCelly'
cell.textLabel.text = title;
//cell.textLabel.text = date;
cell.detailTextLabel.text = description
return cell;
}
ストーリーボードでは、RootTableViewContollerセルからDetailTableViewControllerへのセグエの名前は次のとおりです。ShowADVDetail
感謝します
1月