I'm new to ios development and have been reading up the docs on the apple website, where I stumbled upon NSTask
, as well as NSOperation
. I'm unable to tell the difference between the two in terms of what they actually do. Could someone please list out what the difference between them is and when it is appropriate to use each of them?
Edit: What I don't understand is how they are different from each other.
The docs say an NSTask
object is used to run a subprocess and can only be run once.
They also say that an NSOperation
encapsulates a task that can only be run once.
They seem to do the exact same thing. That's why I want to know the pros/cons of using each of them.