Image-Capture-Core - withCompleteContentCatalog not firing (Rust + Obj-C)

From the imagecapturecore-rs crate here: https://github.com/brandonhamilton/image-capture-core-rs/issues/7

Only didOpenSessionWithError fires when connecting a PTP (picture transfer protocol) device with a None for the error value and an NSArray with a count of 0.

decl.add_method(
sel!(device:didOpenSessionWithError:),
device_did_open_session_with_error as extern "C" fn(&Object, Sel, id, id),
);
println!(" 📸 add_method didCloseSessionWithError");
decl.add_method(
sel!(device:didCloseSessionWithError:),
device_did_close_session_with_error as extern "C" fn(&Object, Sel, id, id),
);
println!(" 📸 add_method didRemoveDevice");
decl.add_method(
sel!(didRemoveDevice:),
device_did_remove_device as extern "C" fn(&Object, Sel, id),
);
println!(" 📸 add_method withCompleteContentCatalog");
decl.add_method(
sel!(withCompleteContentCatalog:),
device_did_become_ready as extern "C" fn(&Object, Sel, id),
);

Do I need to be using the fancier cameraDevice.requestOpenSession() with the callback function from here? https://developer.apple.com/documentation/imagecapturecore/icdevice/3142916-requestopensession


As seen on StackOverflow: https://stackoverflow.com/questions/68978185/apple-ptp-withcompletecontentcatalog-not-firing-rust-obj-c

Answered by mikeumus in 686489022

It was answered on Stack Overflow:

Protocol ICCameraDeviceDelegate declares

  • deviceDidBecomeReadyWithCompleteContentCatalog:

instead of

  • withCompleteContentCatalog:

See ICDeviceDelegate and ICCameraDeviceDelegate.


https://stackoverflow.com/a/68993325/1762493

Thank you Willeke 🙇🏻‍♂️

Accepted Answer

It was answered on Stack Overflow:

Protocol ICCameraDeviceDelegate declares

  • deviceDidBecomeReadyWithCompleteContentCatalog:

instead of

  • withCompleteContentCatalog:

See ICDeviceDelegate and ICCameraDeviceDelegate.


https://stackoverflow.com/a/68993325/1762493

Thank you Willeke 🙇🏻‍♂️

Image-Capture-Core - withCompleteContentCatalog not firing (Rust + Obj-C)
 
 
Q