Re: Unknown name type for an imported class in Xcode 6.x iOS 8 project
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: William Squires <email@hidden>
- Date: Thu, 30 Apr 2015 20:44:08 -0500
On Apr 30, 2015, at 4:57 PM, Quincey Morris <email@hidden> wrote:
> On Apr 30, 2015, at 13:29 , William Squires <email@hidden> wrote:
>>
>> If I understand properly, you can't have a circular #import
>
> You can in the sense that if A.h #imports B.h, and B.h #imports A.h, then B.h can only see the contents of A.h up till the point that it #imports B.h. It’s circular (and therefore doesn’t produce the desired effect), though it’s not recursive like #include can be.
>
Oh, okay. I figured it would do something like:
* Import A.h and determine that it hasn't been read yet; read it into memory. Mark it as 'in-use'
* Compiler/pre-processor sees a #import "B.h" in A.h, and goes back to step 1, this time reading in B.h.
* It then sees that B.h hasn't been read yet, and reads it into memory. It is then marked as 'in-use'
* The compiler then sees that B.h #imports "A.h", but realizes that A.h is already in use, and skips it.
* It continues processing B.h until EOF, then releases the in-use flag, and closes B.h
* At this point, it has all the symbol table info from B.h, and returns to processing A.h from the line just after the #import "B.h"
* It then has all the symbol table info from A.h as well, then releases its in-use flag, and closes the file.
Now, both the symbols from A.h and B.h have been read (only once), and no infinite loop causes the SPOD. :)
Guess not...
[snip]
_______________________________________________
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