しめ鯖日記

swift, iPhoneアプリ開発, ruby on rails等のTipsや入門記事書いてます

今更だけどOther linker flagsの-ObjCについて調べてみた

-ObjCとは何かを調べてみました。

-ObjCを入れる理由

こちらのページに説明がありました。

Technical Q&A QA1490: Building Objective-C static libraries with categories

A: If you're seeing a "selector not recognized" runtime exception when calling a category method that is implemented in a static library, you are hitting the link-time build issue described here, and need to add the -ObjC linker flag to your project, by following these steps:

こちらによると-ObjCがないとstatic libraryのカテゴリーのメソッドが呼べなくなる事があるようです。