initWithMarkdownString method

NSAttributedString? initWithMarkdownString(
  1. NSString markdownString, {
  2. NSAttributedStringMarkdownParsingOptions? options,
  3. NSURL? baseURL,
})

initWithMarkdownString:options:baseURL:error:

iOS: introduced 15.0.0 macOS: introduced 12.0.0

Implementation

NSAttributedString? initWithMarkdownString(
  NSString markdownString, {
  NSAttributedStringMarkdownParsingOptions? options,
  NSURL? baseURL,
}) {
  objc.checkOsVersionInternal(
    'NSAttributedString.initWithMarkdownString: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_initWithMarkdownString_options_baseURL_error_,
      markdownString.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);
  }
}