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

# AMAProfileAttribute 类

该类的方法创建预定义和自定义的个人资料属性。

AppMetrica 允许您创建最多 100 个自定义属性。

# Instance methods {#instance_summary}

#|
|| +[出生日期](#method_birthDate) | 创建预定义的出生日期/年龄属性。 ||
|| +[customBool:](#method_customBool) | 创建一个自定义属性，类型为 `bool`。 ||
|| +[自定义计数器:](#method_customCounter) | 创建具有标签类型的自定义属性。 ||
|| +[自定义数字:](#method_customNumber) | 创建一个自定义属性，类型为 `double`。 ||
|| +[自定义字符串:](#method_customString) | 创建一个自定义属性，类型为 `string`. ||
|| +[性别](#method_gender) | 创建预定义的性别属性。 ||
|| +[名称](#method_name) | 创建一个预定义的名称属性。 ||
|| +[notificationsEnabled](#method_notificationsEnabled) | 创建一个预定义的通知状态属性。 ||
|#

## Method descriptions {#method_detail}

### +birthDate {#method_birthDate}

```objectivec translate=no
+ (id<AMABirthDateAttribute>)birthDate
```

创建生日属性。

{% note alert %}

AppMetrica 在网页界面中不会显示 [预定义属性](https://appmetrica.yandex.com.tr/docs/zh/data-collection/profile-attributes.md#pre-defined)，如果 `ProfieId` 发送未配置。

{% endnote %}

**返回：**

实现 [AMABirthDateAttribute](https://appmetrica.yandex.com.tr/docs/zh/sdk/ios/analytics/objectivec/AMABirthDateAttribute.md) 协议的实例。

### +customBool: {#method_customBool}

```objectivec translate=no
+ (id<AMACustomBoolAttribute>)customBool:(NSString *)name
```

创建一个自定义属性，类型为 `bool`。

**参数：**

#|
|| `名称` | Attribute name. 该值最多可包含 200 个字符。 ||
|#

**返回：**

实现 [AMACustomBoolAttribute](https://appmetrica.yandex.com.tr/docs/zh/sdk/ios/analytics/objectivec/AMACustomBoolAttribute.md) 协议的实例。

### +customCounter: {#method_customCounter}

```objectivec translate=no
+ (id<AMACustomCounterAttribute>)customCounter:(NSString *)name
```

创建自定义标签类型的属性。

**参数：**

#|
|| `名称` | 创建自定义属性，类型为标签。 ||
|#

**返回：**

实现 [AMACustomCounterAttribute](https://appmetrica.yandex.com.tr/docs/zh/sdk/ios/analytics/objectivec/AMACustomCounterAttribute.md) 协议的实例。

### +customNumber: {#method_customNumber}

```objectivec translate=no
+ (id<AMACustomNumberAttribute>)customNumber:(NSString *)name
```

创建一个自定义属性，类型为 `double`。

**参数：**

#|
|| `名称` | 创建具有标签类型的自定义属性。 ||
|#

**返回：**

实现 [AMACustomNumberAttribute](https://appmetrica.yandex.com.tr/docs/zh/sdk/ios/analytics/objectivec/AMACustomNumberAttribute.md) 协议的实例。

### +customString: {#method_customString}

```objectivec translate=no
+ (id<AMACustomStringAttribute>)customString:(NSString *)name
```

创建一个自定义属性，类型为 `string`。

**参数：**

#|
|| `名称` | Attribute name. 该值最多可包含 200 个字符。 ||
|#

**返回：**

实现 [AMACustomStringAttribute](https://appmetrica.yandex.com.tr/docs/zh/sdk/ios/analytics/objectivec/AMACustomStringAttribute.md) 协议的实例。

### +gender {#method_gender}

```objectivec translate=no
+ (id<AMAGenderAttribute>)gender
```

创建性别属性。

{% note alert %}

AppMetrica 在网页界面中不会显示 [预定义属性](https://appmetrica.yandex.com.tr/docs/zh/data-collection/profile-attributes.md#pre-defined)，如果 `ProfieId` 发送未配置。

{% endnote %}

**返回：**

实现 [AMAGenderAttribute](https://appmetrica.yandex.com.tr/docs/zh/sdk/ios/analytics/objectivec/AMAGenderAttribute.md) 协议的实例。

### +name {#method_name}

```objectivec translate=no
+ (id<AMANameAttribute>)name
```

创建一个名称属性。

{% note alert %}

AppMetrica 在网页界面中不会显示 [预定义属性](https://appmetrica.yandex.com.tr/docs/zh/data-collection/profile-attributes.md#pre-defined)，如果 `ProfieId` 发送未配置。

{% endnote %}

**返回：**

实现 [AMANameAttribute](https://appmetrica.yandex.com.tr/docs/zh/sdk/ios/analytics/objectivec/AMANameAttribute.md) 协议的实例。

### +notificationsEnabled {#method_notificationsEnabled}

```objectivec translate=no
+ (id<AMANotificationsEnabledAttribute>)notificationsEnabled
```

创建一个预定义的通知状态属性。

{% note alert %}

AppMetrica 在网页界面中不会显示 [预定义属性](https://appmetrica.yandex.com.tr/docs/zh/data-collection/profile-attributes.md#pre-defined)，如果 `ProfieId` 发送未配置。

{% endnote %}

**返回：**

实现 [AMANotificationsEnabledAttribute](https://appmetrica.yandex.com.tr/docs/zh/sdk/ios/analytics/objectivec/AMANotificationsEnabledAttribute.md) 协议的实例。
