<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreNFC",
  "identifier" : "/documentation/CoreNFC/NFCNDEFMessage/init(data:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core NFC"
    ],
    "preciseIdentifier" : "c:objc(cs)NFCNDEFMessage(cm)ndefMessageWithData:"
  },
  "title" : "init(data:)"
}
-->

# init(data:)

Creates an NDEF message from raw data representing the message.

```
convenience init?(data: Data)
```

## Parameters

`data`

A data object containing the raw bytes of a complete NDEF message. The data must contain only one NDEF message, and the message must contain NDEF payloads that are valid according to the NFC Forum NDEF RTD specification.

## Return Value

An NDEF message, or `nil` when the raw data is invalid.

## Discussion

---

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)