Johan Nordberg
Johan Nordberg

Reputation: 3777

Fire and forget NSOperation

If I add a NSOperation to [NSOperationQueue mainQueue] and don't really care about the result, can I be sure that it will run even though the object that added it to the queue goes out of scope?

The operation performs a HTTP request, but even if it fails I don't want to inform the user about the error.

Upvotes: 1

Views: 43

Answers (1)

Adam
Adam

Reputation: 26917

Yes, because the operation queue will retain the operation.

Upvotes: 1

Related Questions