我正試圖在選項卡欄應用程序中開發一個RSS閱讀器向下鑽取故事板。我設法用解析的XML填充我的RootTableViewController。我現在有一個問題,弄清楚如何讓我的RootTableViewController中的每一行指向並將所選單元格的數據傳遞給另一個DetailTableViewController。UITableView詳細說明使用故事板的UITableView向下鑽取
這是我的代碼部分來解析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的SEGUE的名字是ShowADVDetail
幫助不大讚賞
Jan