Ios 使用ASIHTTPRequest启动同步并更新UITableView,但由于EXC\u BAD\u访问失败

Ios 使用ASIHTTPRequest启动同步并更新UITableView,但由于EXC\u BAD\u访问失败,ios,objective-c,uitableview,asynchronous,asihttprequest,Ios,Objective C,Uitableview,Asynchronous,Asihttprequest,在viewDidLoad中 在startpost 在cellForRowAtIndexPath中 当我提交时,它将在应用程序启动后立即崩溃,以进行EXC_BAD_访问 cell.titleLabel.text =[[dataToBeShown objectAtIndex:row] objectAtIndex:2]; [cell.image setImageWithURL:[[dataToBeShown objectAtIndex:row] objectAtIndex:1] ]; ,而不是崩溃

在viewDidLoad中

在startpost

在cellForRowAtIndexPath中

当我提交时,它将在应用程序启动后立即崩溃,以进行EXC_BAD_访问

cell.titleLabel.text =[[dataToBeShown objectAtIndex:row] objectAtIndex:2];

[cell.image setImageWithURL:[[dataToBeShown objectAtIndex:row] objectAtIndex:1] ];

,而不是崩溃。因此我发现dataToBeShown为空。如何执行此操作?

请在分配前检查数组

伊夫罗 或者执行“签入号码行”部分

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return dataToBeShown.count;
}

这将删除EXC\u BAD\u访问。

请注意ASIHttpRequest已被弃用,并且在iOS 7中存在已知错误。我敦促您停止使用AshtpRequest,转而使用类似的工具。@rckoenes好的,先生,我会按照您的指示去做。谢谢。
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

NSString *indentifier=@"indentifier";
RecommedTableViewCell *cell =(RecommedTableViewCell *)[tableView dequeueReusableCellWithIdentifier:indentifier];
if (cell == NULL)
{

    cell=[[RecommedTableViewCell alloc]init];    }
NSInteger row=[indexPath row];



cell.titleLabel.text =[[dataToBeShown objectAtIndex:row] objectAtIndex:2];

[cell.image setImageWithURL:[[dataToBeShown objectAtIndex:row] objectAtIndex:1] ];


return cell;

}
cell.titleLabel.text =[[dataToBeShown objectAtIndex:row] objectAtIndex:2];

[cell.image setImageWithURL:[[dataToBeShown objectAtIndex:row] objectAtIndex:1] ];
    [cell.image setImageWithURL:[[dataToBeShown objectAtIndex:row] objectAtIndex:1] ];
 }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return dataToBeShown.count;
}