Reputation: 2075
I have an idea on how to do this, but I want to make sure I do it right....
I have five data classes. When I use one I typically use all of them (but not always).
Each class has a separate header file. I am getting sick of linking in each header file separately.
What is the best way resolve this issue?
Upvotes: 2
Views: 2622
Reputation: 243156
Create a new header file called "DataFiles.h". Inside that, have your five #import
statements. Then whenever you need the file classes, just #import "DataFiles.h"
.
Beware of circular dependencies.
(This is how Cocoa, Foundation, UIKit, CoreData, etc all behave. Notice that you just #import <Cocoa/Cocoa.h>
, which imports everything else. Open up Cocoa.h
and take a look)
Upvotes: 12