Question

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)
Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top