获取 - [NSNull countByEnumeratingWithState:objects:count:]

时间:2016-05-13 09:39:18

标签: ios objective-c nsarray

我试图过滤一个数组并摆脱所有重复的字符串。

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

1 个答案:

答案 0 :(得分:0)

以上错误想要在将数组添加到数组中时说“您已获得NULL值”。因此,您有两种可能出现此错误

1)[initialWomensCategoryArray addObject:object]

2)[womensDataArray addObject: obj]

我认为您必须检查第一个([initialWomensCategoryArray addObject:object]