concurrency - ios - sending data to NSOperation or should I use NSThread? -
i have core data objects created/updated via http. want create background thread continuously receive timestamp , state info app , update core data objects. should use nsoperation or gcd this? since it's not simple task, nsoperation seems better since can loop within it, can't figure out how pass information operation, main thread, while it's running. there simple way of doing this? have seen many threads/articles sending messages main thread operation, nothing passing messages it.
does using nsoperation/gcd seem solution?
step , relook @ architecture. should using managed object context uses private dispatch queue (option nsprivatequeueconcurrencytype).
you use nsurlconnections data want, , when data in delegate method can asynchronously update repository using performblock
.
conversely may want retrieve data using performblockandwait
, using block variables or mutable pre-defined objects receive results block.
Comments
Post a Comment