Search code examples
objective-cios6

String preceeded by @ gets an error: unexpected '@' in program


Can anybody tell me what's wrong with this statement? (it's complaining about the @ before the "Services" string). It's the same as multiple examples I have found... I tried a "Clean" but still no luck.

NSString *bundle = [[NSBundle mainBundle] pathForResource: @”Services” ofType: @”plist”];

Solution

  • If you've copy-pasted this code direct from your IDE, I would start by looking at why you have abnormal quotes:

    @”Services” is not the same as @"Services"