• 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: Warnings that won't go away
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warnings that won't go away


  • Subject: Re: Warnings that won't go away
  • From: Uli Kusterer <email@hidden>
  • Date: Fri, 2 Dec 2005 17:46:39 +0100

Am 30.11.2005 um 19:37 schrieb Alastair Houghton:
For instance, if your header depends on a system header, and won't work without it included, it's best to #import/#include it in the header file rather than requiring every source file that imports your header to also include/import the other header.

Alistair is completely right here (no surprise there...), but one thing I'd like to clarify is that this means *the header* wouldn't work (i.e. wouldn't even compile) without the system header. OTOH, if your class's header doesn't expose the system header's symbols, it may actually make the compiler's job much easier to *only* include that system header in your implementation file, and not in the header.

Again, this is meant to avoid dependencies and needlessly pulling in dozens of headers into the files that use your header.

OTOH, if your class uses a special framework, including the header for that framework in your class's header file may actually serve as a reminder to also add the framework (then again, a comment could work just as well).

Cheers,
-- M. Uli Kusterer
http://www.zathras.de


_______________________________________________
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
  • Prev by Date: Detecting a bad archive?
  • Next by Date: NSCell subclassing to contain other NSCells
  • Previous by thread: Detecting a bad archive?
  • Next by thread: NSCell subclassing to contain other NSCells
  • Index(es):
    • Date
    • Thread