• 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: HElp with importing headers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HElp with importing headers


  • Subject: Re: HElp with importing headers
  • From: Sherm Pendley <email@hidden>
  • Date: Mon, 31 May 2004 15:23:20 -0400

On May 28, 2004, at 4:47 PM, email@hidden wrote:

This is probably really basic but i don't know how to do it...

I have a file interface in project/control/interface.h

how do I make the above file include project/gfx/scene/someScene.h

where project is the name of the project directory?

That's generally not the best thing to do, as it creates additional dependencies that can slow down your project builds. More often, you'd use the @class directive in interface.h to declare any classes used as argument and/or return types. Then you'd import someScene.h into interface.m, so the full definition of those classes is available there.

That way, files that #import interface.h, but don't otherwise use the classes or types found in someScene.h, won't need to be rebuilt if changes are made to someScene.h. It's not worth worrying about for small projects, but when your project grows to dozens or even hundreds of files, you'll want to keep the dependencies as few as possible to keep build times within reason.

Anyway, to import local headers - i.e. headers within your project, as opposed to those found in the header search path - use double-quotes instead of angle brackets, and specify the path to the header relative to the path to the target file, like this:

#import "../gfx/scene/someScene.h"

sherm--
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >HElp with importing headers (From: email@hidden)

  • Prev by Date: Re: cocoa and database
  • Next by Date: Re: Insert NSImage into NSTextView
  • Previous by thread: HElp with importing headers
  • Next by thread: Enriched text in NSAttributedString?
  • Index(es):
    • Date
    • Thread