Such error happens sometimes when listing the same tableView, I mean sometimes yes and sometimes no. When I try to check retrieved NSSet
for if he contains any objects:
if(coin.dublicates.count > 0)
I get error :
*** -[NSMutableSet unionSet:]: set argument is not an NSSet'
What would be the reason for such error? whole method listing:
if(period.regions.count == 0) {
for(Nominal *nominal in period.nominals) {
if(nominal.coins.count>0) {
counter+=[[nominal.coins filteredSetUsingPredicate:[NSPredicate predicateWithFormat:@"listed==%@",[NSNumber numberWithBool:YES]]]count];
for(Coin *coin in nominal.coins)
{
if(coin.dublicates.count > 0) {
counter+=coin.dublicates.count;
}
}
}
}
}
screenshot:
Thank you in advance.
Verify the NSSet is not nil before evaluating its count.