---
metadata:
  - name: generator
    content: Diplodoc Platform v5.70.0
alternate:
  - https://appmetrica.yandex.by/docs/en/sdk/ios/analytics/objectivec/AMABirthDateAttribute.md
  - https://appmetrica.yandex.by/docs/ru/sdk/ios/analytics/objectivec/AMABirthDateAttribute.md
  - https://appmetrica.yandex.by/docs/zh/sdk/ios/analytics/objectivec/AMABirthDateAttribute.md
  - href: https://appmetrica.yandex.by/docs/zh/sdk/ios/analytics/objectivec/AMABirthDateAttribute.md
    type: text/markdown
    title: Markdown version
  - href: https://appmetrica.yandex.by/docs/zh/llms.txt?revision=r22089357
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://appmetrica.yandex.by/docs/zh/llms.txt?revision=r22089357

# AMABirthDateAttribute 协议

该协议定义了更新用户资料中年龄或出生日期的方法。

## Instance methods {#instance_summary}

#|
|| -[withAge:](#method_withAge) | 更新属性值。 ||
|| -[withYear:](#method_withYear) | 更新属性值。 ||
|| -[withYear:月:](#method_withYear_month) | 更新属性值。 ||
|| -[带年:月:日:](#method_withYear_month_day) | 更新属性值。 ||
|| -[withDateComponents:](#method_withDateComponents) | 更新属性值。 ||
|| -[withValueReset](#method_withValueReset) | 重置属性值。 ||
|#

## Method descriptions {#method_detail}

### -withAge: {#method_withAge}

```objectivec translate=no
- (AMAUserProfileUpdate *)withAge:(NSUInteger)value
```

更新属性值。

**参数：**

#|
|| `value` | 年龄。 ||
|#

**返回：**

The `AMAUserProfileUpdate` 类实例。

### -withYear: {#method_withYear}

```objectivec translate=no
- (AMAUserProfileUpdate *)withYear:(NSUInteger)year
```

更新属性值。

**参数：**

#|
|| `年` | 出生年份。 ||
|#

**返回：**

The `AMAUserProfileUpdate` 类实例。

### -withYear:month: {#method_withYear_month}

```objectivec translate=no
- (AMAUserProfileUpdate *)withYear:(NSUInteger)year month:(NSUInteger)month
```

更新属性值。

**参数：**

#|
|| `年` | 出生年份。 ||
|| `月` | 出生月份。 ||
|#

**返回：**

The `AMAUserProfileUpdate` 类实例。

### -带年:月:日: {#method_withYear_month_day}

```objectivec translate=no
- (AMAUserProfileUpdate *)withYear:(NSUInteger)year month:(NSUInteger)month day:(NSUInteger)day
```

更新属性值。

**参数：**

#|
|| `年` | 出生年份。 ||
|| `月` | 出生月份。 ||
|| `天` | 出生日期。 ||
|#

**返回：**

The `AMAUserProfileUpdate` 类实例。

### -withDateComponents: {#method_withDateComponents}

```objectivec translate=no
- (AMAUserProfileUpdate *)withDateComponents:(NSDateComponents *)dateComponents
```

更新属性值。

**参数：**

#|
|| `dateComponents` | The [NSDateComponents](https://developer.apple.com/documentation/foundation/nsdatecomponents) 类实例。 ||
|#

**返回：**

The `AMAUserProfileUpdate` 类实例。

### -withValueReset {#method_withValueReset}

```objectivec translate=no
- (AMAUserProfileUpdate *)withValueReset
```

重置属性值。

**返回：**

The `AMAUserProfileUpdate` 类实例。
