I am just starting to learn Objective-C programming. I am developing in Xcode 4.2 on Mac OS X version 10.7.2 on iMac. I am reading Stephen Cochan's book Objective-C Programming, which contains a simple Hello World example:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog (@"Hello, World!");
[pool drain];
return 0;
}
When compiling, many errors are reset:
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.hhaps13:19: error: unknown type name 'NSString' [1]
There are many more. Is there something you need to do before compiling for the first time? Some settings in Xcode?
source
share