斐伊川,我得到的值從模型類的UITableView具有NsDictionary.Here是我的代碼如何從tableview中NSDictionary的值傳遞給下一個視圖
- (UITableViewCell *)tableView:(UITableView *)atableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//UILabel *label = nil;//label to hold description of city
static NSString *CellIdentifier = @"Cell"; //cell identifier for each section oftable
UITableViewCell *cell = [atableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"]autorelease]; //cell
}
// cell.backgroundColor = [UIColor clearColor];//cell background color
cell.selectionStyle = UITableViewCellSelectionStyleNone;
//label.backgroundColor = [UIColor clearColor];
cell.textLabel.font = [UIFont fontWithName:@"Arial" size:15.0];
cell.textLabel.text = [NSString stringWithFormat:@"%@",[(Tweet *)[recentTweets objectAtIndex:indexPath.row] author]];
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@",[(Tweet *)[recentTweets objectAtIndex:indexPath.row] tweet]];
cell.detailTextLabel.numberOfLines = 10;
cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",
[(Tweet *)[recentTweets objectAtIndex:indexPath.row]urlString]]]]];
cell.imageView.image = image;
return cell;
}
- (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)connectionIdentifier {
recentTweets = [[NSMutableArray alloc] init] ;
for(NSDictionary *d in statuses) {
NSLog(@"See dictionary: %@", d);
Tweet *tweet = [[Tweet alloc] initWithTweetDictionary:d];
[recentTweets addObject:tweet ];
NSLog(@"%@",[tweet author]);
NSLog(@"%@",[tweet urlString]);
[tweet release];
}
[self.tableView reloadData];
}
我想在一個視圖中顯示鳴叫的細節。如何將其傳遞給下一個視圖控制器
@ user640780請投了答案,當你接受他們... – visakh7 2011-05-03 07:31:41