gpt4 book ai didi

c++ - 不合格的 id 错误 iOS

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:03:36 28 4
gpt4 key购买 nike

我正在尝试编译一个 Xcode 项目,但我收到了一堆不需要的错误,例如这个

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/i PhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:13:1: error: expected unqualified-id

该项目运行良好,但当我尝试在我的应用程序委托(delegate)中包含此文件“iRate.h”时,一切都出错了。我试图包含 iRate 的应用程序委托(delegate)类是用 c++(cpp 文件)编写的。我不知道您可能还需要什么其他信息,但这几乎可以概括一切

这是另一条错误消息,希望这会有所帮助

  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:418:50: error: unknown type name 'NSString'
FOUNDATION_EXPORT Protocol *NSProtocolFromString(NSString *namestr) NS_AVAILABLE(10_5, 2_0);
^
^

最佳答案

如果您将 C++ 与 Objective-C 混合使用,则需要为您的文件提供 .mm 文件扩展名。

关于c++ - 不合格的 id 错误 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17790439/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com