0

In my app delegate header, I have:

#import <UIKit/UIKit.h>

@interface CJSHAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end

When I try to run it, the @interface line gets the error, "Expected identifier or '('", and the @end line gets, "'@end' must appear in an Objective-C context", and after this, main.m gets "Use of undeclared identifier 'CJSHAppDelegate". None of these have happened before.

What is causing this, and what can be addressed? I would expect it to be secondary damage, but don't know where to look.

An English translation of the error message would be helpful; I believe the error is reported for Xcode-generated boilerplate code.

--EDIT--

The main.m, requested in a response, is:

//
//  Created by jonathan on 9/27/13.
//  Copyright (c) 2013 Jonathan Hayward. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "CJSHAppDelegate.h"

int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([CJSHAppDelegate class]));
    }
}
Jk1
  • 11,233
  • 9
  • 54
  • 64
Christos Hayward
  • 5,777
  • 17
  • 58
  • 113
  • I have experienced this before and it turns out I had a stray `(`, `)`, `{`, `[` or `]` in my implementation file. Check the `CJSHAppDelegate.m` for any syntax errors with extra or missing symbols. – Popeye Jul 08 '14 at 08:22
  • have you not typed any special character into the source-code accidentally, which is not visible for human eyes, but it is still there? that may confuse the compiler. – holex Jul 08 '14 at 09:39
  • @holex I'm not sure I fully understand your comment, mainly around `"which is not visible for human eyes"` if it's not visible how do you expect him to find it? And if it was typed accidentally then wouldn't it be visible? – Popeye Jul 08 '14 at 10:44
  • @Popeye, not every unicode character has visible representation in the actual font. accidentally, it is possible to type such character, which cannot be interpreted by compiler. usually the compiler drops a warning or an error then the typo is obviously wrong, but that is not clear in every situation and you cannot spot the typed extra character because there it cannot be visualised in the editor with the selected font – as not everyone uses the standard monospaced font (or colour-set). – holex Jul 08 '14 at 10:53
  • @holex that kind of makes sense. Thank you for clearing the confusion. – Popeye Jul 08 '14 at 10:57
  • @Popeye, I'm not saying that is the problem, but there is a chance for it, and it may be worth to double-check. – holex Jul 08 '14 at 11:00

0 Answers0