Sunday, October 16, 2011

"expected error before @ token"


iPhone programming like a noob - expected error before @ token 10.16.2011 - I've recently been teaching myself to program for the iOS platform in Xcode using iPhone Programming: The Big Nerd Ranch Guide (I have no idea what level of permanence an Amazon.com link has...). Anyway - one problem I encountered while trying to compile a demo program was "expected error before @ token".
Here is an example of an expression that threw me a curveball:

[questions addObject:@"What is 7 + 7?"];


It turns out that not all quotation marks are created equal, and the problem was due to pasted code from a PDF with fancy slanted quotation marks. Deleting the pasted quotation marks and manually typing the quotation marks immediately solves the problem.

Just a heads up if anyone out there is googling for a solution!