Frage

What's the difference between these two ways of fetching an object in Core Data? Is one more efficient than the other? Do they do the same thing?

MR_findFirstByAttribute:(NSString *) withValue:(id) inContext:(NSManagedObjectContext *)

vs

MR_findFirstByAttribute:(NSString *) withValue:(id)
War es hilfreich?

Lösung

They do exactly the same thing, it's just that one allows you to supply a context and the other goes and gets the context for the current thread ([NSManagedObjectContext MR_contextForCurrentThread]). If you already have the appropriate context then it's more efficient to supply it yourself.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top