<!--
{
  "availability" : [
    "iOS: 9.3.0 -",
    "iPadOS: 9.3.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 9.2.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKContainer/fetchAllLongLivedOperationIDsWithCompletionHandler:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKContainer(im)fetchAllLongLivedOperationIDsWithCompletionHandler:"
  },
  "title" : "fetchAllLongLivedOperationIDsWithCompletionHandler:"
}
-->

# fetchAllLongLivedOperationIDsWithCompletionHandler:

Fetches the IDs of any long-lived operations that are running.

```
- (void) fetchAllLongLivedOperationIDsWithCompletionHandler:(void (^)(NSArray<NSString *> *outstandingOperationIDs, NSError *error)) completionHandler;
```

## Parameters

`completionHandler`

The block doesn’t return a value and takes the following parameters:

- `outstandingOperationsByIDs`: The IDs of all of the long-lived operations that are running.
- `error`: An error if a problem occurs, or `nil` if CloudKit successfully retrieves the IDs.

## Discussion

A long-lived operation is one that continues to run after the user closes the app. When a long-lived operation completes, or your app or the system cancels it, it’s no longer active and CloudKit doesn’t include its ID in `outstandingOperationsByIDs`. An operation is complete when the system calls its completion handler.

Use the [`fetchLongLivedOperationWithID:completionHandler:`](/documentation/CloudKit/CKContainer/fetchLongLivedOperationWithID:completionHandler:) method to fetch the operation for a specific ID.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)