---
title: NSAttributeDescription
framework: coredata
role: symbol
role_heading: Class
path: coredata/nsattributedescription
---

# NSAttributeDescription

A description of a single attribute belonging to an entity.

## Declaration

```swift
class NSAttributeDescription
```

## Overview

Overview NSAttributeDescription inherits from NSPropertyDescription, which provides most of the basic behavior. Instances of NSAttributeDescription are used to describe attributes, as distinct from relationships. The class adds the ability to specify the attribute type, and to specify a default value. In a managed object model, you must specify the type of all attributes—you can only use the undefined attribute type (NSUndefinedAttributeType) for transient attributes. Editing Attribute Descriptions Attribute descriptions are editable until they are used by an object graph manager. This allows you to create or modify them dynamically. However, once a description is used (when the managed object model to which it belongs is associated with a persistent store coordinator), it must not (indeed cannot) be changed. This is enforced at runtime: any attempt to mutate a model or any of its sub-objects after the model is associated with a persistent store coordinator causes an exception to be thrown. If you need to modify a model that is in use, create a copy, modify the copy, and then discard the objects with the old model. note: Default values set for attributes are retained by a managed object model, not copied. This means that attribute values do not have to implement the NSCopying protocol, however it also means that you should not modify any objects after they have been set as default values.

## Topics

### Managing the type

- [attributeValueClassName](coredata/nsattributedescription/attributevalueclassname.md)
- [type](coredata/nsattributedescription/type.md)
- [NSAttributeDescription.AttributeType](coredata/nsattributedescription/attributetype-swift.struct.md)
- [attributeType](coredata/nsattributedescription/attributetype-swift.property.md)
- [NSAttributeType](coredata/nsattributetype.md)

### Configuring the behavior

- [allowsCloudEncryption](coredata/nsattributedescription/allowscloudencryption.md)
- [allowsExternalBinaryDataStorage](coredata/nsattributedescription/allowsexternalbinarydatastorage.md)
- [defaultValue](coredata/nsattributedescription/defaultvalue.md)
- [preservesValueInHistoryOnDeletion](coredata/nsattributedescription/preservesvalueinhistoryondeletion.md)
- [valueTransformerName](coredata/nsattributedescription/valuetransformername.md)

### Getting version information

- [versionHash](coredata/nsattributedescription/versionhash.md)

### Deprecated

- [Deprecated symbols](coredata/nsattributedescription-deprecated-symbols.md)

## Relationships

### Inherits From

- [NSPropertyDescription](coredata/nspropertydescription.md)

### Inherited By

- [NSCompositeAttributeDescription](coredata/nscompositeattributedescription.md)
- [NSDerivedAttributeDescription](coredata/nsderivedattributedescription.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Standard attributes

- [NSPropertyDescription](coredata/nspropertydescription.md)
- [NSAttributeType](coredata/nsattributetype.md)
- [NSRelationshipDescription](coredata/nsrelationshipdescription.md)
