<!--
{
  "availability" : [
    "iOS: 4.3.0 -",
    "iPadOS: 4.3.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/objc_allocateProtocol(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:@F@objc_allocateProtocol"
  },
  "title" : "objc_allocateProtocol(_:)"
}
-->

# objc_allocateProtocol(_:)

Creates a new protocol instance.

```
func objc_allocateProtocol(_ name: UnsafePointer<CChar>) -> Protocol?
```

## Parameters

`name`

The name of the protocol you want to create.

## Return Value

A new protocol instance or `nil` if a protocol with the same name as `name` already exists.

## Discussion

You must register the returned protocol instance with the [`objc_registerProtocol(_:)`](/documentation/ObjectiveC/objc_registerProtocol(_:)) function before you can use it.

There is no dispose method associated with this function.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)