以下の内容はhttps://anton0825.hatenablog.com/entry/20140822/1413423937より取得しました。


MagicalRecordを使ってテスト用にCoreDataオブジェクトを生成する

data storeをmemoryにして、contextからオブジェクトを生成すればOK。

[MagicalRecord setupCoreDataStackWithInMemoryStore];
NSManagedObjectContext *context = [NSManagedObjectContext MR_defaultContext];
CurrencyPair *cp = [CurrencyPair MR_createInContext:context];

CoreDataは強制的にDBとオブジェクトが紐付けられてしまうので気軽にオブジェクトも作れないなぁ。。
参考:ios - How do I use Magical Record to create & update objects and save them without using contextForCurrentThread - Stack Overflow




以上の内容はhttps://anton0825.hatenablog.com/entry/20140822/1413423937より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14