我试图过滤一个数组并摆脱所有重复的字符串。
NSMutableArray *initialWomensCategoryArray = [NSMutableArray new];
for(NSArray *womensCategoryInnner in [objects valueForKey:@"womensCategory"])
{
for(id object in womensCategoryInnner)
{
[initialWomensCategoryArray addObject:object];
womensDataArray = [[NSMutableArray alloc]init];
for (id obj in initialWomensCategoryArray)
{
if (![womensDataArray containsObject:obj])
{
[womensDataArray addObject: obj];
}
}
}
}
答案 0 :(得分:0)
以上错误想要在将数组添加到数组中时说“您已获得NULL值”。因此,您有两种可能出现此错误
1)[initialWomensCategoryArray addObject:object]
2)[womensDataArray addObject: obj]
我认为您必须检查第一个([initialWomensCategoryArray addObject:object]
)