0

I searched for a many days, but I can not find it. What would be the equivalent of the following MagicalRecord statement in Realm.io?

[MagicalRecord saveUsingCurrentThreadContextWithBlock:^(NSManagedObjectContext *localContext) {

    // Save block

} completion:^(BOOL success, NSError *error) {

    // Completion block

}];

I need "Save block", and when it finish, execute "Completion block"

Thanks!!

mhergon
  • 1,688
  • 1
  • 18
  • 39

1 Answers1

1

the equivalent in Realm is -[RLMRealm transactionWithBlock:].

Since both your MagicalRecord example and Realm's equivalent run in the current thread, the completion block is a bit redundant because it's equivalent to adding code immediately after the call to this method.

jpsim
  • 14,329
  • 6
  • 51
  • 68