title: Xcode 6 compile error on device
body: <p>SUMMARY:</p>
  
  <ul>
  <li>I get a compile error on the device but not the simulator </li>
  <li>The error description is certainly not the root cause of the problem</li>
  <li>I think it has to do with standard imports of SDK classes</li>
  <li>It might have to do with having an iOS8 extension in the app</li>
  <li>There is a similar problem description on stackoverflow, but the
  solution does not work for me</li>
  </ul>
  
  <p>I'm stuck with a strange problem in Xcode 6. The project compiles fine on the Simulator, but I get a compile error whenever I try to compile for the device.</p>
  
  <p>The project has been created from a tabbar template (note: Xcode 6 project templates have no prefix file anymore by default) and consists of an iOS app and the new extension enhancements introduced in iOS8. Both the app and the extension should use some base classes, namely a class which uses AFNetworking for fetching data from the net.</p>
  
  <p>As described in AFNetworking docs, I declared AF_APP_EXTENSION to be able to compile the extension.
  I am not sure if any of this is related to the problem, just trying to throw some facts and hoping something rings a bell for someone.</p>
  
  <p>Anyway, it is in AFNetworking where I get the build errors:
  "No visible @interface for 'UIDevice' declares the selector 'systemVersion'" in AFURLRequestSerialization.</p>
  
  <p>When playing around with imports, for instance importing UIKit.h at some random points for trying, I sometimes (!) get a different error:</p>
  
  <p>"No visible @interface for 'UIImage' declares the selector 'initWithData:'" in AFURLResponseSerialization.</p>
  
  <p>Needless to say that these are these methods are declared since iOS 2.0. I think it has something to do with the new way of importing base classes and the lack of a prefix file.</p>
  
  <p><a href="https://stackoverflow.com/questions/25754324/xcode-6-gm-wont-compile-for-ios-device-but-is-fine-in-simulator-odd-error-me">Here</a> is a so post describing, I think, exactly the same problem, but the solution, setting Enable Modules to NO, does not work at all for me, I get then 50+ compile errors about missing classes as UIResponder in AppDelegate and stuff.
  I guess this is because the Enable Module setting is the replacement for the prefix imports? But I am really swimming here. </p>
  
  <p>I tried cleaning, clean build folder, restart Xcode, restart Mac, add imports here and there, reading LLVM compiler settings in build settings.</p>
  
  <p>Does anyone have an idea how I can resolve this? Any help appreciated!</p>