Why am I still allowed to use functions and create objects from the NSObject class when I didn’t import it?
int main (int argc, char *argv[])
{
@autoreleasepool {
NSLog(@"hi");
NSArray *array = [NSArray arrayWithObject: @"hello"];
NSLog(@"%@", array);
}
return 0;
}
Output
2012-08-11 22:15:33.854 prog[1282:403] hi
2012-08-11 22:15:33.857 prog[1282:403] (
hello
)
Most likely you have a Precompiled/Prefix header that imports Foundation, So Foundation gets implicitly added to each header. Look for a file called *-Prefix.pch. Xcode normally puts it in a group called Supporting Files.