日々精進

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

NSManagedObjectのサブクラスに追加したプロパティにアクセスするとselector not recognizedエラーが出る

確かにプロパティがあるのに、アクセスするとそんなセレクタ無いよというエラーが出る。なぜ。。
以下のようにsynthesizeを追加したら直った。不思議すぎる。

@interface CurrencyPair()
@property(nonatomic, strong) CurrencyPairSettingViewModel *createdViewModel;
@end

@implementation CurrencyPair
@synthesize createdViewModel = _createdViewModel;
・・・
@end