objective c - Compile-time warning about missing category method implementation -


in our xcode project have multiple targets share common code. each target includes sources used it. when use category methods inside classes shared between targets need make sure category implementation included in targets. xcode doesn't show warnings during compile time or link time if forget include category implementation of targets. , troublesome hand.

is there automated way ensure category implementations included targets use them?

categories not automatically linked final binary.

they linked if linker finds file defined used (which source of constant bug times ago).

what can use special flag on linker: '-all_load' , '-objc' in build settings/linking/other linker flags

-objc loads members of static archive libraries implement objective-c class or category.

and discussion:

-all_load , -force_load tell linker link entire static archive in final executable, if linker thinks parts of archive unused.

another way use force link module put c function in file:

void _linkwithnblogclass(void) {     nslog(@"%s", __function__); } 

and call @ start of application:

 linkwithnblogclass(); 

this way, console feedback, i'm sure module loaded , ready used.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -