iphone - How can I use different .h files for several targets? -
i have project several targets. of classes, can use single .h
file , change details in .m
file (adding different .m file each target).
for 1 of uiviewcontroller
subclasses, need declare different uilabel iboutlet
s different targets (each target shows different set of labels depending on what's available). problem header files can't targeted. there's no checkbox next them specify target membership.
the way i've been dealing add outlets of targets , ignore unused ones. doesn't seem ideal.
do need use header build phase this? what's best way deal problem? thanks.
edit: should have mentioned want .h files have same name: placeviewcontroller.h
.
you can use preprocessor directives selectively include header files. instance
#if target_os #import "firsttarget.h" #else #import "secondtarget.h" #endif
you can use different folders different targets if headers named same:
#if target_os #import "first/target.h" #else #import "second/target.h" #endif
you can read more conditionals here.
Comments
Post a Comment