---
title: NSRelationshipDescription
framework: coredata
role: symbol
role_heading: Class
path: coredata/nsrelationshipdescription
---

# NSRelationshipDescription

A description of a relationship between two entities.

## Declaration

```swift
class NSRelationshipDescription
```

## Overview

Overview NSRelationshipDescription provides additional attributes that are specific to modeling a relationship between two entities. For the common attributes of all property types, see NSPropertyDescription. For example, use this class to define a relationship’s cardinality — the number of managed objects the relationship can reference. For a to-one relationship, set maxCount to 1. For a to-many relationship, set maxCount to a number greater than 1 to impose an upper limit; otherwise, use 0 to allow an unlimited number of referenced objects. At runtime, you can modify a relationship description until you associate its owning managed object model with a persistent store coordinator.  If you attempt to modify the model after you associate it, Core Data throws an exception. To modify a model that’s in use, create and modify a copy and then discard any objects that belong to the original model.

## Topics

### Configuring the Destination

- [inverseRelationship](coredata/nsrelationshipdescription/inverserelationship.md)
- [destinationEntity](coredata/nsrelationshipdescription/destinationentity.md)
- [isOrdered](coredata/nsrelationshipdescription/isordered.md)

### Configuring Cardinality

- [isToMany](coredata/nsrelationshipdescription/istomany.md)
- [minCount](coredata/nsrelationshipdescription/mincount.md)
- [maxCount](coredata/nsrelationshipdescription/maxcount.md)

### Configuring Delete Behavior

- [deleteRule](coredata/nsrelationshipdescription/deleterule.md)
- [NSDeleteRule](coredata/nsdeleterule.md)

### Getting Version Data

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

## Relationships

### Inherits From

- [NSPropertyDescription](coredata/nspropertydescription.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)
- [NSAttributeDescription](coredata/nsattributedescription.md)
- [NSAttributeType](coredata/nsattributetype.md)
