07-21-2023, 08:16 PM
for extra info about file dependencies & #import & @class check this out:
[
itis good article
summary of the article
> #imports in header files:
- #import the superclass you’re inheriting, and the protocols you’re implementing.
- Forward-declare everything else (unless it comes from a framework
with a master header).
- Try to eliminate all other #imports.
- Declare protocols in their own headers to reduce dependencies.
- Too many forward declarations? You have a Large Class.
> #imports in implementation files:
- Eliminate cruft #imports that aren’t used.
- If a method delegates to another object and returns what it gets
back, try to forward-declare that object instead of #importing it.
- If including a module forces you to include level after level of
successive dependencies, you may have a set of classes that wants to
become a library. Build it as a separate library with a master
header, so everything can be brought in as a single prebuilt chunk.
- Too many #imports? You have a Large Class.
[1]:
[
[To see links please register here]
][1]itis good article
summary of the article
> #imports in header files:
- #import the superclass you’re inheriting, and the protocols you’re implementing.
- Forward-declare everything else (unless it comes from a framework
with a master header).
- Try to eliminate all other #imports.
- Declare protocols in their own headers to reduce dependencies.
- Too many forward declarations? You have a Large Class.
> #imports in implementation files:
- Eliminate cruft #imports that aren’t used.
- If a method delegates to another object and returns what it gets
back, try to forward-declare that object instead of #importing it.
- If including a module forces you to include level after level of
successive dependencies, you may have a set of classes that wants to
become a library. Build it as a separate library with a master
header, so everything can be brought in as a single prebuilt chunk.
- Too many #imports? You have a Large Class.
[1]:
[To see links please register here]
"#imports Gone Wild! How to Tame File Dependencies"