日々精進

新しく学んだことを書き留めていきます

「[MagicalRecord swizzleShorthandMethods]: unrecognized selector」エラー

実行時に「[MagicalRecord swizzleShorthandMethods]: unrecognized selector」というエラーが出た。
原因はPodプロジェクトをビルドし、リンクする時にデフォルトの設定では使われていないシンボルを削除すること。
アプリのターゲットのBuild SettingsのOther Linker Flags に-all_loadを追加すればシンボルが削除されなくなり、直る。
参考:cocoa - Objective-C unrecognized selector on +initialize with the MagicalRecord CocoaPod - Stack Overflow