initWithMarkdown method
NSAttributedString?
initWithMarkdown(
- NSData markdown, {
- NSAttributedStringMarkdownParsingOptions? options,
- NSURL? baseURL,
initWithMarkdown:options:baseURL:error:
iOS: introduced 15.0.0 macOS: introduced 12.0.0
Implementation
NSAttributedString? initWithMarkdown(
NSData markdown, {
NSAttributedStringMarkdownParsingOptions? options,
NSURL? baseURL,
}) {
objc.checkOsVersionInternal(
'NSAttributedString.initWithMarkdown:options:baseURL:error:',
iOS: (false, (15, 0, 0)),
macOS: (false, (12, 0, 0)),
);
final $err = pkg_ffi.calloc<ffi.Pointer<objc.ObjCObjectImpl>>();
try {
final $ret = _objc_msgSend_1k0ezzm(
object$.ref.retainAndReturnPointer(),
_sel_initWithMarkdown_options_baseURL_error_,
markdown.ref.pointer,
options?.ref.pointer ?? ffi.nullptr,
baseURL?.ref.pointer ?? ffi.nullptr,
$err,
);
objc.NSErrorException.checkErrorPointer($err.value);
return $ret.address == 0
? null
: NSAttributedString.fromPointer($ret, retain: false, release: true);
} finally {
pkg_ffi.calloc.free($err);
}
}