问题
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