core data - What is the difference between "asynchronousFetchRequest" and "create a private context"? -


1.ios8 provided asynchronousfetchrequest,and can create 'private context' fetch results, difference between asynchronousfetchrequest , 'create private context'?

2.the type of nsfetchedresultscontroller's context must mainqueueconcurrencytype?(block ui?) there solution resolve this?

asynchronousfetchrequest create context , perform fetch on context. creating private context means can work on managedobjects on background context without having block main thread while work being performed. if have own context though going have transfer managedobjects onto main thread though, while async fetch request doing that. fetchedresutlscontrollers not need context mainqueueconcurrency, remember if privatequeueconcurrency, cache won't work , need use performblock: method in order work objects. ui can blocked while fetching objects frc, shouldn't take long time. if need speed core data index entities first. if want make sure have data before fetch, can use asynchronousfetchrequest countforfetchrequest have number returned , act accordingly.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -