magicalrecord-2.1

awakeFromInsert called twice with nested contexts

人盡茶涼 提交于 2019-12-02 13:07:16
问题 This project uses Mogenerator and Magical Record. I have tracked down a bug to the fact that awakeFromInsert is getting called twice. Once for each of my contexts I presume. This is an issue because I need to listen for NSNotifications on this NSManagedObject like this: - (void)awakeFromInsert { // Listen for a return from background mode [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enteringForeground:) name:UIApplicationWillEnterForegroundNotification object:nil]