2016-03-31 4 views
2

gibt es die Fehler beenden app aufgrund nicht abgefangene Ausnahme 'NSInvalidArgumentException', Grund: ‚- [__ NSCFString countByEnumeratingWithState: Objekte: count:]: Unbekannter Selektor gesendet zum Beispiel 0x16e09f70'[__NSCFString countByEnumeratingWithState: Objekte: count:]: Unbekannter Selektor zum Beispiel 0x16e09f70' gesendet

if (finalArray.count != 0) 
    { 
     NSMutableDictionary *fetchDict = [[NSMutableDictionary alloc]initWithDictionary:[finalArray objectAtIndex:indexPath.row]]; 
     NSMutableArray *valueArr = [[NSMutableArray alloc]initWithArray:[fetchDict allValues].mutableCopy]; 


     for (NSMutableArray *one in valueArr) { 
      for (NSMutableArray *two in one) // Program Stops on This Line 
      { 
       cell.textLabel.text = [NSString stringWithFormat:@"%@",[two valueForKey:@"Note"]]; 
      } 
     } 

    } 
} 
+2

so denken Sie, die Array-Arrays enthält, aber es nicht, es enthält mindestens eine Saite ... – Wain

Antwort

3

Versuchen Sie, diese

if (finalArray.count != 0) 
{ 
    NSMutableDictionary *fetchDict = [[NSMutableDictionary alloc]initWithDictionary:[finalArray objectAtIndex:indexPath.row]]; 
    NSMutableArray *valueArr = [[NSMutableArray alloc]initWithArray:[fetchDict allValues].mutableCopy]; 


    for (NSMutableArray *one in valueArr) { 
     if ([one isKindOfClass:[NSMutableArray class]]) { //Check if array here 
      for (NSMutableArray *two in one) 
      { 
       cell.textLabel.text = [NSString stringWithFormat:@"%@",[two valueForKey:@"Note"]]; 
      } 
     }else { 
      NSLog(@"Program stops because this one: %@", one); 
     } 
    } 

} 
+0

Arbeitete Dank !! Prost !! (y) – niks290192

0

dieses, das hilft

if (finalArray.count != 0) 
    { 
     NSDictinory *fetchDict = [finalArray objectAtIndex:indexPath.row]; 

    cell.textLabel.text = [NSString stringWithFormat:@"%@",[fetchDict valueForKey:@"Note"]]; 

    } 
} 

Hoffnung versuchen.

+0

Dank Kamlesh für Ihre Bemühungen. Tim007 gab die Arbeitslösung. – niks290192

+0

Das ist großartig (y) –

Verwandte Themen