---
title: "MDItemCopyAttribute(_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1427080-mditemcopyattribute
---

# MDItemCopyAttribute(_:_:)

Returns the value of the specified attribute in the metadata item.

## Declaration

```swift
func MDItemCopyAttribute(_ item: MDItem!, _ name: CFString!) -> CFTypeRef!
```

## Parameters

- `item`: The item to be queried.
- `name`: The name of the requested attribute.

## Return Value

Return Value A CFTypeRef, or NULL if there was a failure reading the attribute or the attribute does not exist.

## See Also

### Retrieving Metadata Attributes 

- [MDItemCopyAttributes(_:_:)](coreservices/1426980-mditemcopyattributes.md)
- [MDItemCopyAttributeNames(_:)](coreservices/1427066-mditemcopyattributenames.md)
