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)
有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top