开发者

Objective-C errors with Xcode

开发者 https://www.devze.com 2023-02-21 20:20 出处:网络
I added a simple class to my Xcode command line tool project. The class is shown below: #import <Foundation/Foundation.h>

I added a simple class to my Xcode command line tool project. The class is shown below:

#import <Foundation/Foundation.h>

@interface Foo : NSObject {
}
@end

and

#import "Foo.h"

@implementation Foo
@end

As soon as I reference Foo.h using #import "Foo.h" in my main file I get all type of errors. I have Foundation.frameowork added as my frameworks.

/Developer/SDKs/MacOSX10.6.sdk/System/
    Library/Frameworks/Foundation.framework/Headers/
NSObjCRuntime.h:189:1: error: expected identifier or '(' [3]

/Develope开发者_Go百科r/SDKs/MacOSX10.6.sdk/System/
    Library/Frameworks/Foundation.framework/Headers/
NSObjCRuntime.h:197:50: error: unknown type name 'Protocol' [3]


I'm guessing that you probably need to rename main.c to main.m? Otherwise, can you post the content of your main file?

0

精彩评论

暂无评论...
验证码 换一张
取 消