TBXML in an iOS 8 extension fails to build

独自空忆成欢 提交于 2019-12-10 20:27:45

问题


In my iOS app I use TBXML for xml processing, it's not officially updated but it still working fine for me.

I'm trying to create a Today extension for iOS 8 and when I add TBXML as a Compile Source I get the following:

TBXML.h

Before adding the extension, I didn't have any build issue with TBXML.

Any ideas of how can I resolve this?

Thanks


回答1:


Fixed by adding #import <Foundation/Foundation.h> at the beggining of TBXML.h.

Seems that when working with extension, this file is not imported or is imported later




回答2:


I always want to know WHY. Why would it work before without the include of foundation and not now? What changed? So I dug a little deeper and found the answer: Prefix headers. Xcode 5 must had automatically added a prefix header as a convenience or something. And the new one doesn't. That old prefix header automatically included Foundation, Availability, and UIKit.

Who knows why they changed it. Maybe it has something to do with swift.

A more detailed answer is at: Unknown type name 'NSError' and others



来源:https://stackoverflow.com/questions/25150929/tbxml-in-an-ios-8-extension-fails-to-build

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!