I'm using NSMapTable in a program that must run under both 3.0 and 2.2.1. As expected, the program compiles without problems for the 2.2.1 libraries, but when I switch to 3.0, I get compiler errors:
error: expected specifier-qualifier-list before 'NSMapTable'
In other words, XCode can't find the declaration of the NSMapTable class. I had to put in a forward declaration (@class NSMapTable) in my own header and
#import <Foundation/NSMapTable.h>
in my implementation file in order to be able to use NSMapTable.
Any explanations for this? Or is it just a bug, plain and simple?
(I should point out that I do, of course, have #import in the header file of the class that uses NSMapTable, but still need the specific import.)