xcode 找不到“NSObject”的接口声明,“GPXType”的超类

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27164942/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:15:58  来源:igfitidea点击:

cannot find interface declaration for 'NSObject', superclass of 'GPXType'

iosobjective-cxcodegpx

提问by Rahul Saini

I have done some research on that issue , but I have not found anything similar just yet.

我对这个问题做了一些研究,但我还没有发现任何类似的东西。

I am using iOS GPX framework to draw the path on map using GPX file. I have import iOS GPX.framework on my project. but I have face an issue.

我正在使用 iOS GPX 框架使用 GPX 文件在地图上绘制路径。我在我的项目中导入了 iOS GPX.framework。但我遇到了一个问题。

Please Guide me, If anyone has any advice...

请指导我,如果有人有任何建议......

enter image description here

在此处输入图片说明

采纳答案by Rahul Saini

Finally I have solved my problem

最后我解决了我的问题

I have import #import < UIKit/UIKit.h>and change my Xcode 6 Architectures $(ARCHS_STANDARD_32_BIT).

我导入了 #import < UIKit/UIKit.h>并更改了我的 Xcode 6 Architectures $(ARCHS_STANDARD_32_BIT)

Thanks so much Guys.

非常感谢伙计们。

回答by l0gg3r

Just modify the header file, add this line on top of the file

只需修改头文件,在文件顶部添加这一行

#import <Foundation/Foundation.h>

Seems they thought that you will have a PCHfile, where Foundation and UIKit will be imported, but Xcode 6 removed PCH default support, so the problem came. (See my previous answer)

似乎他们认为您将有一个PCH文件,将在其中导入 Foundation 和 UIKit,但是 Xcode 6 删除了 PCH 默认支持,因此问题来了。(见我之前的回答

回答by Ondrej Rafaj

You haven't imported the header file #import ...

你还没有导入头文件#import ...

When compiling for both iOS and OsX, I had similar issue that I have resolved by importing TargetConditionals.h. The final thing looks like this:

在为 iOS 和 OsX 编译时,我遇到了类似的问题,我通过导入 TargetConditionals.h 解决了这个问题。最后看起来像这样:

#import <TargetConditionals.h>

#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE

#import <UIKit/UIKit.h>

#elif TARGET_OS_MAC

#import <Cocoa/Cocoa.h>

#endif



@interface MyClass : NSObject

#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE

// Define UIKit methods

#elif TARGET_OS_MAC

// Define Cocoa methods

#endif

- (void)reloadRegisteredComponents;


@end