I am checking that the entries in my dictionary are not 0 using NSDictionary count. It works and returns the correct number except on iPad 4.3 Simulator and iPads running iOS 4.3.
Is this a known bug in iOS 4 or am I seeing a side effect of something else I am doing which is iOS 4 incompatible?
edit:
Thank you for your comments so far! I am happy to believe that it’s my code; I’m new to this. Here is a greatly simplified version of my code.
-(NSDictionary *)dictionaryOfSets
{
if (!_dictionaryOfSets)
{
NSOrderedSet* set1 = [[NSOrderedSet alloc] initWithObjects:
[NSNumber numberWithInt:(1)],
[NSNumber numberWithInt:(2)],
[NSNumber numberWithInt:(3)],
[NSNumber numberWithInt:(4)],
nil];
NSOrderedSet* set2 = [[NSOrderedSet alloc] initWithObjects:
[NSNumber numberWithInt:(9)],
[NSNumber numberWithInt:(10)],
[NSNumber numberWithInt:(11)],
nil];
_dictionaryOfSets = [[NSDictionary alloc] initWithObjectsAndKeys:
set1, [NSNumber numberWithInt:(1)],
set2, [NSNumber numberWithInt:(2)],
nil];
[set1 release];
[set2 release];
}
return _dictionaryOfSets;
}
After a few weeks of searching and tests I have concluded that NSOrderedSet does not work under iOS 4.3. The same code works under iOS 5.0 and 5.1. I have replaced the NSOrderedSet with NSSet and it now works under iOS 4.3. I am surprised that I haven’t found documentation covering that.