Slee
Slee

Reputation: 28248

Objective-C : expected ']' before ';' token

Trying to follow some basic examples and getting stuck by this code that is EXACTLY like the example I am following:

[[NSUserDefaults standardUserDefaults] setObject:@"Sample Text" forKey:kWordsOfWisdom];

gives me the error:

expected ']' before ';' token

Upvotes: 1

Views: 844

Answers (1)

Slee
Slee

Reputation: 28248

I had this:

#define kWordsOfWisdom @"Sample Text";

that ; on the end was the problem.

Upvotes: 3

Related Questions