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 iboutlets 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

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -