• 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: PCH not being used
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PCH not being used


  • Subject: Re: PCH not being used
  • From: Burt Johnson <email@hidden>
  • Date: Sun, 22 Jan 2006 13:53:37 -0800

>I think the problem is that the pch file is a precompiled header.
>Since it's pre-compiled, any pre-compiler macros or definitions you
>put in it will be gone by the time you compile the rest of your code.
>You need to create a new header file (perhaps windefs.h?) with the
>definitions you need and then #import those into any code that will
>need them. The .pch file is just not the right place to put this.

Oh?  I thought that would just be used for all files.

Thanks for the clarification.  I just made a quick test, and putting it
into a global Win.h does make it respond as expected.

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)
--


- Burt Johnson
  MindStorm, Inc.
  email@hidden
  http://www.mindstorm-inc.com
 _______________________________________________
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

  • Follow-Ups:
    • Re: PCH not being used
      • From: Adam Leonard <email@hidden>
References: 
 >PCH not being used (From: Burt Johnson <email@hidden>)
 >Re: PCH not being used (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: Re: NSWorkspace ... launchApplication
  • Next by Date: Re: Searching a controller's content
  • Previous by thread: Re: PCH not being used
  • Next by thread: Re: PCH not being used
  • Index(es):
    • Date
    • Thread