<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFURLEnumeratorGetNextURL(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFURLEnumeratorGetNextURL"
  },
  "title" : "CFURLEnumeratorGetNextURL(_:_:_:)"
}
-->

# CFURLEnumeratorGetNextURL(_:_:_:)

Advances an enumerator to the next URL.

```
func CFURLEnumeratorGetNextURL(_ enumerator: CFURLEnumerator!, _ url: UnsafeMutablePointer<Unmanaged<CFURL>?>!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> CFURLEnumeratorResult
```

## Parameters

`enumerator`

The enumerator.

`url`

Contains the next URL if this function returns [`CFURLEnumeratorResult.success`](/documentation/CoreFoundation/CFURLEnumeratorResult/success).

`error`

Contains error information if this function returns [`CFURLEnumeratorResult.error`](/documentation/CoreFoundation/CFURLEnumeratorResult/error). Error information is retained and must be released. Can be `NULL`.

## Return Value

The result of advancing the enumerator.

## Discussion

If this function returns [`CFURLEnumeratorResult.end`](/documentation/CoreFoundation/CFURLEnumeratorResult/end), the enumeration has finished.

A return value of [`CFURLEnumeratorResult.error`](/documentation/CoreFoundation/CFURLEnumeratorResult/error) does not imply that the enumeration has finished.

If this function returns [`CFURLEnumeratorResult.error`](/documentation/CoreFoundation/CFURLEnumeratorResult/error), the user info dictionary of `error` is populated with the following entries (when possible):

- The [`kCFErrorUnderlyingErrorKey`](/documentation/CoreFoundation/kCFErrorUnderlyingErrorKey) entry is populated with the underlying error if the underlying error is not in the [`kCFErrorDomainCocoa`](/documentation/CoreFoundation/kCFErrorDomainCocoa) domain.
- The <doc://com.apple.documentation/documentation/Foundation/NSURLErrorKey> entry is populated with the URL that caused the error, as a [`CFURL`](/documentation/CoreFoundation/CFURL) object.
- The <doc://com.apple.documentation/documentation/Foundation/NSFilePathErrorKey> entry is populated with the file path that caused the error, as a [`CFString`](/documentation/CoreFoundation/CFString) object.

## See Also

[`CFURLEnumeratorResult`](/documentation/CoreFoundation/CFURLEnumeratorResult)

Result codes from the [`CFURLEnumeratorGetNextURL(_:_:_:)`](/documentation/CoreFoundation/CFURLEnumeratorGetNextURL(_:_:_:)) function.



---

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)