문제

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