本文介绍了iOS上MacOSX CoreServices中的编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是我在使用框架时做错的一些愚蠢的事情,但是我现在花了几个小时,希望有人能提供帮助!

This is probably some silly thing I did wrong in using frameworks, but I spent some hours now, and hope someone can help!

我的编译错误:

Expected * before *error: expected declaration specifiers or '...' before 'CFXMLTreeRef'.都在`/Developer/SDKs/ MacOSX10.6.sdk /System/Library/Frameworks/ CoreServices .framework´

Expected * before * and error: expected declaration specifiers or '...' before 'CFXMLTreeRef' in WSMethodInvocation.h and WSProtocolHandler.h. Both in `/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/CoreServices.framework´

它们列出了包含UIKitFoundation的文件.我已经包括了这些框架,但没有包括CoreServices框架.

They list files where UIKit and Foundation are included. I have included these framework, but not the CoreServices framework.

我尝试过的事情:

  • 从我的项目文件夹中删除了框架(意外地将其复制到该文件夹​​中)(添加时我已选中复制资源".)
  • 我已确保框架搜索路径为空. (来自​​此问题 )
  • 我选择了项目中所有框架上的在查找器中显示,它们都位于/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/System/Library下.
  • 此答案中,它说: CoreServices 在iOS上不可用.相反,请使用#import <CFNetwork/CFNetwork.h>,所以我拼命尝试了,没有运气.但是,为什么我什至在 MacOSX CoreServices 类之一中出现错误?
  • I removed frameworks from my project folder that was accidentally copied there (I had checked "Copy resources" while adding them.)
  • I have made sure that the Framework Search Paths is empty. (from this question)
  • I chose Show in finder on all frameworks in the project, and they are all located under /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/System/Library.
  • In this answer it says Most of the CoreServices are not available on iOS. Instead, use #import <CFNetwork/CFNetwork.h>, so I tried that, desperately, with no luck. But again why do I even get an error in one of the MacOSX CoreServices classes?

在开始添加和移动项目和框架之前,一切都很好.我试图将所有内容恢复到以前的状态.

It all worked fine before I started adding and moving projects and frameworks. I have tried to restore everything to how it was before, when it was working.

推荐答案

我将所有代码移到了新项目中.使用相同的框架,效果很好.

I moved all my code to a new project. Works fine, using the same frameworks.

如果有人对发生的事情有所了解,那还是值得欢迎的. :)

If anyone have an idea of what broke, that is still welcome. :)

这篇关于iOS上MacOSX CoreServices中的编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 23:46