When calling the Objective-C method from Swift, if the argument is pointer **, how should I call it?
objective-c swift
For example,
- NSData initWithContentsOfURL: (NSURL*)aURL
options: (NSDataReadingOptions) mask
error: (NSError**) errorPtr]
This is
let url:NSURL=//NSURL instance
varerror: Declared as NSError?=nil//var.make optional
let data = NSData(contentsOfURL:url, options:.DataReadingMappedIfSafe, error: & error)
will look like this
Apple publication Using Swift with Cocoa and Objective-C (link is Apple Developer's site with the same content).
Interacting with CAPIs → Pointers section of this e-book.
C Syntax:Type**
Swift Syntax:AutoreleasingUnsafeMutablePointer<Type>
and so on.
However, you can't tell what to do without looking at the actual program code.To be honest, I'm confused and still don't understand.
611 Uncaught (inpromise) Error on Electron: An object could not be cloned
568 Who developed the "avformat-59.dll" that comes with FFmpeg?
601 GDB gets version error when attempting to debug with the Presense SDK (IDE)
891 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.