---
title: "value(withName:inPropertyWithKey:)"
framework: objectivec
role: symbol
role_heading: Instance Method
path: "objectivec/nsobject-swift.class/value(withname:inpropertywithkey:)"
---

# value(withName:inPropertyWithKey:)

Retrieves a named object from the collection specified by the passed key.

## Declaration

```swift
func value(withName name: String, inPropertyWithKey key: String) -> Any?
```

## Discussion

Discussion The method valueIn<Key>WithName: is used if it exists. Otherwise, raises an NSUndefinedKeyException.

## See Also

### Access by name, key, or ID

- [insertValue(_:inPropertyWithKey:)](objectivec/nsobject-swift.class/insertvalue(_:inpropertywithkey:).md)
- [value(withUniqueID:inPropertyWithKey:)](objectivec/nsobject-swift.class/value(withuniqueid:inpropertywithkey:).md)
