gpt4 book ai didi

ios - [__NSCFString countByEnumeratingWithState :objects:count:]: unrecognized selector sent to instance 0x16e09f70'

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:38:45 40 4
gpt4 key购买 nike

由于未捕获的异常“NSInvalidArgumentException”而导致错误 Terminating app,原因:“-[__NSCFString countByEnumeratingWithState:objects:count:]: 无法识别的选择器发送到实例 0x16e09f70”

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"]];
}
}

}
}

最佳答案

试试这个

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);
}
}

}

关于ios - [__NSCFString countByEnumeratingWithState :objects:count:]: unrecognized selector sent to instance 0x16e09f70',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36328756/

40 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com