2014-02-22 50 views
0

阻碍错误信息的发现,但无法找到错误。谁能帮我?Xcode“发送到实例的无法识别的选择器”

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


    if (indexPath.section == 0) { 

    NSDictionary *aktion = self.wmXMLParser.alleAktionen [indexPath.row]; 
    __block NSString *VP= @""; 

    [aktion enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { 
     if (VP.length) { 
      VP = [VP stringByAppendingString:@","]; 
     } 
     VP = [NSString stringWithFormat:@"%@%@ = %@", VP, key, obj]; 
    }]; 

    cell.spielpaarungLabel.text = VP; 
+0

后完整的错误信息,请。应该有班级名称 – Avt

+0

或代码行,发生错误。 – Avt

+0

这意味着你的实例没有这样的方法。检查你是否发送消息到错误的实例。例如,当前应该是[A aMethod],但您可以调用[B aMethod]。它有时在使用收集而没有检查时发生。 –

回答

0

它在我看来好像您需要设置故事板中的单元格类型。它目前设置为UITableViewCell而不是ErgebnisseCell,因此没有spielsparungLabel属性。

0

从方法

[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; 

的细胞中被返回是不是类型ErgebnisseCell的,因此将不响应的

spielpaarungLabel 

方法。

确保你在故事板或笔尖文件中的单元格的标识设置为“ErgebnisseCell”

+0

你好, 这正是我的问题。在故事板中,我没有分配自定义单元格。 但现在我有一个新问题。标签“spielpaarungLabel”没有填充数据,虽然字符串“VP”数据有(见日志)。 – carlie

+0

这是日志数据:2014-02-23 14:10:12.346信息[4010:70b] Brasilien:Kroatien = Spielpaarung,0:0 = Ergebniss,12 =标识符,12.06.14 = Spieltag1 2014-02-23 14:10:12.347信息[4010:70b] Brasilien:Kroatien = Spielpaarung,0:0 = Ergebniss,12 =标识符,12.06.14 = Spieltag1 2014-02-23 14:10:12.347信息[4010:70b] 13.06 .14 = Spieltag2,13 =标识符,0:0 = Ergebniss,Mexiko:Kamerun = Spielpaarung – carlie

+0

您是否已将自定义单元格类中的IBOutlet连接到界面构建器中的Label? –

相关问题