---
title: maxCount
framework: coredata
role: symbol
role_heading: Instance Property
path: coredata/nsrelationshipdescription/maxcount
---

# maxCount

The maximum number of managed objects the relationship can reference.

## Declaration

```swift
var maxCount: Int { get set }
```

## Discussion

Discussion If you declare a relationship attribute as optional when defining your entities, the framework only enforces minCount and maxCount when that attribute is not nil. The default value is 0.

## See Also

### Configuring Cardinality

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