3

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 TBXML.h

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

Any ideas of how can I resolve this?

Thanks

estemendoza
  • 3,023
  • 5
  • 31
  • 51

2 Answers2

10

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

estemendoza
  • 3,023
  • 5
  • 31
  • 51
  • 3
    Wasted almost a day on this project. Makes no sense to me. Two projects, one created in Xcode5 and one in Xcode6. The one created in Xcode5 doesn't need these includes. The one created in Xcode6 has errors all over the place. – badweasel Sep 13 '14 at 22:58
  • This (and getting rid of the dealloc in the TBXML.m) still works on 8.2. And yes, it would be nice to know what's going on. – user3741598 Mar 28 '17 at 15:31
1

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

Community
  • 1
  • 1
badweasel
  • 2,349
  • 1
  • 19
  • 31