Re: Syntax error when declaring an IBOutlet
Re: Syntax error when declaring an IBOutlet
- Subject: Re: Syntax error when declaring an IBOutlet
- From: Mark Teagarden <email@hidden>
- Date: Thu, 06 Mar 2008 14:00:10 -0600
- Thread-topic: Syntax error when declaring an IBOutlet
Hi Paul,
> I'll bet your World.h includes '#import "Game.h"' which creates an
> import cycle when imported from Game.h, but not when imported by
> WMapView.h.
Actually, it does. I was concerned that all of these objects needed outlets
to each other, and that since (in my imperfect understanding) I had to
import the headers of any object I wanted an outlet to point to, that there
might be some a problem with all of those #imports. Since my understanding
was that Obj-C uses #import instead of #include specifically to ensure that
a header was only loaded once, I thought that would solve those types of
problems.
>
>> 2. Why should @class work when #import doesn't? Hillegass flat out
>> says
>> that the two are interchangeable.
>
> Where does he say that? I see the following in 2e Cocoa Programming:
>
> You could replace '@class PreferenceController;' with '#import
> "PreferenceController.h"'. This statement would import the header, and
> the compiler would learn that PreferenceController was a class.
> Because the 'import' command requires the compiler to parse more
> files, '@class' will often result in faster builds.
>
> which does _not_ call them interchangeable.
>
Well, I am perfectly willing to admit that I was wrong but frankly I didn't
see anything in there suggesting that they were NOT interchangeable,
especially as there wasn't any discussion of differences between the two.
In reading it, I felt like @class was simply introduced with no actual
explanation of what it did.
Anyway, I think you're right about my program having an import cycle, which
I will now read up on. Thank you very much for your help.
Mark
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden