All Questions
Tagged with objective-c rust
14
questions
0
votes
1
answer
42
views
Calling NSApplication from Rust using objc
I am trying to learn by doing a project of allowing AppKit certain functions , related with App and Window creation to be called from Rust using objc.
extern crate objc;
use objc::runtime::{Class,...
0
votes
0
answers
36
views
When need to call the Objective C nsautoreleasepool() on Rust side?
I use the objc2 library and their AppKit bindings in my project.
Everything is good but I am not an Objective C developer and a little confused by the Rust implementation of autoreleasepool.
For ...
2
votes
1
answer
220
views
Convert *const __CFData to String in Rust
I am trying to convert *const __CFData to String in rust.
I am trying to get Keyboard language and checking if it is a particular language.
let current_source = ffi::...
0
votes
1
answer
108
views
Objective-C NSRunLoop & NotificationCenterDelegate not functional when spawned on Rust worker thread
I'm currently trying to use Rust C interop in order to send actional desktop notifications (using a modified version of this lib). The main goal here would be to handle these notification sending ...
2
votes
1
answer
550
views
How to pass out parameter to function from Swift FFI?
Let's say I have a function defined in Rust, which looks like this:
#[no_mangle]
pub unsafe extern "C" fn do_something(
my_value: *mut MyStruct,
some_param: c_uint,
content: *mut ...
1
vote
1
answer
797
views
How to call function using objc in Rust
I want to run a function of Cocoa's Quartz Window Services on Mac called CGWindowListCopyWindowInfo using a library called objc from Rust, is it possible?
I can't figure out how to run function it ...
0
votes
3
answers
354
views
Rust Cocoa - How to make an NSDictionary?
I've been reading around trying to understand it. You can see here dictionaryWithObjects:objects the takes an array of Objects and Keys:
NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:...
2
votes
3
answers
395
views
Rust Cocoa - How to Iterate NSArray
From brandonhamilton/image-capture-core-rs's ICCameraDevice.mediaFiles() I can get the NSArray::count() (from core-foundation-rs) :
let cam_media_files = camera_device.mediaFiles();
println!(
...
0
votes
1
answer
204
views
Apple PTP - 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 ...
0
votes
1
answer
789
views
Rust bindgen clang error, incompatible constant for this __builtin_neon function
Trying to generate bindings for an Obj-C++ header which is a part of Superpowered crossplatform audio library with rust bindgen.
I am in Catalina 10.15.6,
clang version 10.0.1
Target: x86_64-apple-...
1
vote
1
answer
880
views
The correct way to manage cocoa memory when working with Objective-C from Rust
I'm struggling with one issue related to the cocoa foundation memory management. Basically I have a project, written in Rust and I'm using cocoa-rs and objc-rs to interact with Objective-C. I'm ...
1
vote
1
answer
140
views
How do I determine the actual values of certain Objective-C constants?
I'm using Objective-C functions in my Rust application through the layer of different bindings. So far it was simple to call Objective-C functions and to implement the required functionality without ...
7
votes
1
answer
2k
views
How to call a Swift function in Rust?
I have a function written in Swift that I want to call from Rust. I've tried exposing it through Objective-C, however I continue to get errors from ld saying it can't find _foo. The Rust project is ...
3
votes
1
answer
248
views
Create cross-platform library to be used from .NET and Objective-C
I feel that it is expected to be possible (to create a library with Rust that can be used from .NET and Objective-C) but after hours of googling I still have not clear picture of how to do so.
Does ...