Re: PCH not being used
Re: PCH not being used
- Subject: Re: PCH not being used
- From: Adam Leonard <email@hidden>
- Date: Sun, 22 Jan 2006 15:05:12 -0800
the pch file is never directly imported by any of your classes at
compile time. The compiler needs to know about the classes used in
the header.
Also, there is no requirement in objective-c that says NSObject must
be the root class. For example, cocoa does have a second root class:
NSProxy.
Generally, it is safe to just always import <Cocoa/Cocoa.h> (or if it
is just a command line app <
Foundation/Foundation.h>) in every class header that uses Cocoa objects.
Adam Leonard
On Jan 22, 2006, at 1:53 PM, Burt Johnson wrote:
However, I am now a bit confused by a related issue. My new global
header
defines a structure that is used a lot. To understand the
elements, I need
to '#import "DataHelpers.h"' from within this new Win.h.
When I do that, I get the following error:
/Users/bj/FitSync/CommonCode/DataHelpers.h:6: error: cannot find
interface
declaration for 'NSObject', superclass of 'DataHelpers'
I thought everything in ObjC inherited from NSObject. If so, I would
assume that all of ObjC automatically knows about this class. Note
that my
pch file now has only the default code:
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
<<<<<<<<<<<<<
That should be sucking in NSObject, shouldn't it? And if it isn't,
that
seems to imply that the pch isn't connected properly for some
reason. (As
a reminder, I used the wizard for "cocoa application", which I
believed
would establish these connections)
--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden