ios - Which tasks are more suitable to NSOperation than GCD? -


this question has answer here:

which tasks better suited using nsoperation opposed using gcd when programming iphone?

to me seem same thing. can't see strengths , weaknesses 1 has on other.

nsoperation built on top of gcd, question more whether use nsoperation or pass block directly gcd.

an nsoperation bulky , needs more boiler-plate codes set up, has lot more functionality. can create same nsoperation subclass in various parts of code , put them queue , run it.

passing block gcd e.g. dispatch_async quick , disposable. typically don't reuse block anywhere else; set block executed @ point of code, passes gcd or other apis, , go on.

so each has merits.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -