开发者

Objective-C errors with Xcode

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜