I'm very new in the world of xcode and Objective- C- Programming. Right now I'm learning programming via "Objective C- Programming: The big Nerd Ranch Guide". Because of an older OSX-Version, I was just able to install xcode 3.2.6. But the book uses the newest xcode version.
while going through the chapters, I faced a problem:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
@autoreleasepool{
NSDate *now = [NSDate date];
NSLog(@"The date is %@", now);
}
return 0;
}
this code sample gives me following error:
"expected expression before @-token"
While searching for a solution in web, I found out that it's a new syntax to xcode 4... I didn't know that there are so major differences between 3.2.6 and the newest version. Now my question: Does that mean all the syntax in xcode 4 has changed to the previous versions and the book is senseless for me? Or is it just this statement? (If yes, how to write in older versions? I even don't know what that statement is good for since I'm a bloody beginner)