initWithContentsOfFile method

ObjCObjectBase? initWithContentsOfFile(
  1. NSString absolutePath, {
  2. required NSString ofType,
})

initWithContentsOfFile:ofType:

Implementation

objc.ObjCObjectBase? initWithContentsOfFile(
  objc.NSString absolutePath, {
  required objc.NSString ofType,
}) {
  objc.checkOsVersionInternal(
    'NSDocument.initWithContentsOfFile:ofType:',
    iOS: (true, null),
    macOS: (false, (10, 0, 0)),
  );
  final _ret = _objc_msgSend_15qeuct(
    this.ref.retainAndReturnPointer(),
    _sel_initWithContentsOfFile_ofType_,
    absolutePath.ref.pointer,
    ofType.ref.pointer,
  );
  return _ret.address == 0
      ? null
      : objc.ObjCObjectBase(_ret, retain: false, release: true);
}