• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unknown name type for an imported class in Xcode 6.x iOS 8 project
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unknown name type for an imported class in Xcode 6.x iOS 8 project


  • Subject: Re: Unknown name type for an imported class in Xcode 6.x iOS 8 project
  • From: email@hidden
  • Date: Fri, 01 May 2015 12:13:15 +0900

The right thing to do is move your header import to the .m file as well as your ivar

You can use 
@class SomeClassName; 
Before the @interface in your .h to do a forward decl of an Objective-C class, if you need to have an ivar or property of SomeClassName in your .h file. 

If you have a lot of stuff, make a framework. Add target framework to the project. It will auto setup to link to it and embed it. 
(Xcode 6 and for iOS 8+)
Then you can import the framework in your .h and everything gets more magical. 

Sent from my iPhone

On 2015/05/01, at 11:37, Quincey Morris <email@hidden> wrote:

On Apr 30, 2015, at 18:44 , William Squires <email@hidden> wrote:

* The compiler then sees that B.h #imports "A.h", but realizes that A.h is already in use, and skips it.

Indeed, but the gotcha is that only the portion of A.h up till #import “B.h” has been processed. (Because this is C, lexical analysis is linear and textual, so it would have been illegal to proceed further in A.h until after B.h has been processed.) Thus, although the author of B.h might have been intending to have all of A.h available at this point, the circularity partially violates the intention. This is presumably what happened to Alex.

One solution is to use forward references rather than circular definitions.

Another is to put the #import “B.h” at the end of A.h instead of earlier. That way, when the rest of A.h gets skipped, nothing important is missed.

The correct choice of solutions depends on what else is being defined in the two header files. There’s no boilerplate solution.

Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Unknown name type for an imported class in Xcode 6.x iOS 8 project (From: Alex Zavatone <email@hidden>)
 >Re: Unknown name type for an imported class in Xcode 6.x iOS 8 project (From: Quincey Morris <email@hidden>)
 >Re: Unknown name type for an imported class in Xcode 6.x iOS 8 project (From: William Squires <email@hidden>)
 >Re: Unknown name type for an imported class in Xcode 6.x iOS 8 project (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Unknown name type for an imported class in Xcode 6.x iOS 8 project
  • Previous by thread: Re: Unknown name type for an imported class in Xcode 6.x iOS 8 project
  • Index(es):
    • Date
    • Thread