小编Dor*_*e M的帖子

用原型单元执行segue

首先请原谅我的英语,因为我是法国人:-)

我是iOS开发者,我尝试使用XCode 4.4的Master Detail视图.

我想要的是:

我的主视图包含带原型单元格的UITableView.当我点击我的单元格时,我想看详细视图.

这是我的代码:

MasterViewController.m

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    // Configure the cell...
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }

    NSDictionary* instrument = [Instruments objectAtIndex:indexPath.row];
    NSLog(@"instrument: %@",instrument);

    NSString* status = [instrument objectForKey:@"status"];
    NSLog(@"status: %@",status);

    NSString* imageName = [NSString stringWithFormat:@"%@48.png", [status lowercaseString]];

    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
    imgView.image = [UIImage imageNamed:imageName];
    cell.imageView.image = …
Run Code Online (Sandbox Code Playgroud)

uitableview ios5 segue xcode4.4

3
推荐指数
1
解决办法
5195
查看次数

标签 统计

ios5 ×1

segue ×1

uitableview ×1

xcode4.4 ×1