Ios 是否在TableView中的行上出现EXC\u错误\u访问错误?

Ios 是否在TableView中的行上出现EXC\u错误\u访问错误?,ios,objective-c,uitableview,Ios,Objective C,Uitableview,我试图在我的表视图单元格(itemDescrip为@“body”)中设置标签的值,由于某种原因,此行引发了EXC_BAD_访问错误: NSDictionary *node = [self.descripData objectAtIndex:indexPath.row]; 我不知道为什么。填充标签的数据来自Drupal端点(当我记录数组时,descripData成功)。所以我不知道为什么这条线让我感到悲伤。想法 ViewController.h @property (assign, nonato

我试图在我的表视图单元格(itemDescrip为@“body”)中设置标签的值,由于某种原因,此行引发了EXC_BAD_访问错误:

NSDictionary *node = [self.descripData objectAtIndex:indexPath.row];
我不知道为什么。填充标签的数据来自Drupal端点(当我记录数组时,descripData成功)。所以我不知道为什么这条线让我感到悲伤。想法

ViewController.h

@property (assign, nonatomic) NSArray *descripData;
ViewController.m

- (void)viewDidLoad {
    [super viewDidLoad];

    NSMutableDictionary *viewParams = [NSMutableDictionary new];
    [viewParams setValue:@"storeditems" forKey:@"view_name"];
    [DIOSView viewGet:viewParams success:^(AFHTTPRequestOperation *operation, id responseObject) {
        self.descripData = responseObject;
        NSLog(@"%@",self.descripData);

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Failure: %@", [error localizedDescription]);
    }];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *DoctorsTableIdentifier = @"StorageItemTableViewCell";

    StorageItemTableViewCell *cell = (StorageItemTableViewCell *)[tableView dequeueReusableCellWithIdentifier:DoctorsTableIdentifier];
    if (cell == nil) {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"StorageItemTableViewCell" owner:self options:nil];
        cell = [nib objectAtIndex:0];

        NSDictionary *tmp = [self.storageData objectForKey:[NSString stringWithFormat:@"%d",(long)indexPath.row]];

        [[cell itemName] setText:(NSString *)[tmp objectForKey:@"title"]];

        NSString *title = [tmp objectForKey:@"title"];
        [[cell itemName] setText:title];

        NSDictionary *node = [self.descripData objectAtIndex:indexPath.row];
        [[cell itemDescrip] setText:[node objectForKey:@"body"]];
    }
    return cell;
}

很难说没有看到崩溃堆栈的痕迹。但是,这很可能是由于零值。放入一些nslog(在
单元格中的rowatinexpath
)或断点以查看您的值是否存在。您使用
assign
属性声明
descripData
的具体原因是什么?在99.99%的情况下,对象类型通常不会这样做。也许可以尝试删除
assign
属性,使该属性变强,并查看发生了什么。如果在Xcode中运行该属性时得到该属性,则调试控制台中还应该有一条消息描述该异常。你看到了什么?嘿@DrBeardface,你是个天才。删除分配,并用strong替换它;神奇的谢谢!!:)