diff --git a/cidre/src/av/audio/speech_synthesis.rs b/cidre/src/av/audio/speech_synthesis.rs index de74c890..5c06180d 100644 --- a/cidre/src/av/audio/speech_synthesis.rs +++ b/cidre/src/av/audio/speech_synthesis.rs @@ -423,6 +423,6 @@ mod tests { let attr_str = ns::AttrString::with_string(&str); let ut = av::SpeechUtterance::with_attr_string(&attr_str); assert_eq!(&ut.speech_string(), str); - assert_eq!(ut.speech_attr_string().unwrap().string(), str); + assert_eq!(&ut.speech_attr_string().unwrap().string(), str); } } diff --git a/cidre/src/mc/nearby_service_browser.rs b/cidre/src/mc/nearby_service_browser.rs index 7ae14bcf..1cc7278b 100644 --- a/cidre/src/mc/nearby_service_browser.rs +++ b/cidre/src/mc/nearby_service_browser.rs @@ -48,10 +48,10 @@ impl NearbyServiceBrowser { pub fn set_delegate(&mut self, val: Option<&D>); #[objc::msg_send(myPeerID)] - pub fn my_peer_id(&self) -> &mc::PeerId; + pub fn my_peer_id(&self) -> arc::R; #[objc::msg_send(serviceType)] - pub fn service_type(&self) -> &ns::String; + pub fn service_type(&self) -> arc::R; } #[objc::protocol(MCNearbyServiceBrowserDelegate)] @@ -95,8 +95,8 @@ mod tests { let peer = mc::PeerId::with_display_name(name).unwrap(); let service = ns::str!(c"cidre-txtchat"); let browser = mc::NearbyServiceBrowser::with_peer(&peer, &service).unwrap(); - assert_eq!(browser.service_type(), service); - assert_eq!(browser.my_peer_id(), &peer); + assert_eq!(&browser.service_type(), service); + assert_eq!(&browser.my_peer_id(), &peer); assert!(browser.delegate().is_none()); } diff --git a/cidre/src/mps/graph/operation.rs b/cidre/src/mps/graph/operation.rs index 036e32df..b1ccc2b6 100644 --- a/cidre/src/mps/graph/operation.rs +++ b/cidre/src/mps/graph/operation.rs @@ -1,4 +1,4 @@ -use crate::{define_obj_type, mps::graph, ns, objc}; +use crate::{arc, define_obj_type, mps::graph, ns, objc}; define_obj_type!( #[doc(alias = "MPSGraphOperation")] @@ -7,18 +7,18 @@ define_obj_type!( impl Op { #[objc::msg_send(inputTensors)] - pub fn input_tensors(&self) -> &ns::Array; + pub fn input_tensors(&self) -> arc::R>; #[objc::msg_send(outputTensors)] - pub fn output_tensors(&self) -> &ns::Array; + pub fn output_tensors(&self) -> arc::R>; #[objc::msg_send(controlDependencies)] - pub fn control_deps(&self) -> &ns::Array; + pub fn control_deps(&self) -> arc::R>; /// Graph on which the operation is defined #[objc::msg_send(graph)] - pub fn graph(&self) -> &graph::Graph; + pub fn graph(&self) -> arc::R; #[objc::msg_send(name)] - pub fn name(&self) -> &ns::String; + pub fn name(&self) -> arc::R; } diff --git a/cidre/src/ns/attributed_string.rs b/cidre/src/ns/attributed_string.rs index 00dbb5b3..23962950 100644 --- a/cidre/src/ns/attributed_string.rs +++ b/cidre/src/ns/attributed_string.rs @@ -176,7 +176,7 @@ impl AttrString { /// the attributed string object. If you want to maintain a snapshot of this as /// you manipulate the returned string, you should make a copy of the appropriate substring. #[objc::msg_send(string)] - pub fn string(&self) -> &ns::String; + pub fn string(&self) -> arc::R; #[objc::msg_send(length)] pub fn len(&self) -> usize; @@ -358,7 +358,7 @@ mod tests { let str = ns::String::with_str("Hello"); let astr = ns::AttrString::with_string(&str); - assert_eq!(astr.string(), &str); + assert_eq!(&astr.string(), &str); let attrs = astr.attrs_at(0, None).unwrap(); assert!(attrs.is_empty()); diff --git a/cidre/src/ns/file_manager.rs b/cidre/src/ns/file_manager.rs index 58531559..d3508e6c 100644 --- a/cidre/src/ns/file_manager.rs +++ b/cidre/src/ns/file_manager.rs @@ -216,7 +216,7 @@ impl FileManager { } #[objc::msg_send(currentDirectoryPath)] - pub fn current_dir_path(&self) -> &ns::String; + pub fn current_dir_path(&self) -> arc::R; #[objc::msg_send(changeCurrentDirectoryPath:)] pub fn change_current_dir_path(&mut self, path: &ns::String) -> bool; diff --git a/cidre/src/sn/classification_result.rs b/cidre/src/sn/classification_result.rs index e75a817d..602e558a 100644 --- a/cidre/src/sn/classification_result.rs +++ b/cidre/src/sn/classification_result.rs @@ -7,7 +7,7 @@ define_obj_type!( impl Classification { #[objc::msg_send(identifier)] - pub fn id(&self) -> &ns::String; + pub fn id(&self) -> arc::R; #[objc::msg_send(confidence)] pub fn confidence(&self) -> f64; @@ -21,13 +21,13 @@ define_obj_type!( impl ClassificationResult { #[objc::msg_send(classifications)] - pub fn classifications(&self) -> &ns::Array; + pub fn classifications(&self) -> arc::R>; #[objc::msg_send(timeRange)] pub fn time_range(&self) -> cm::TimeRange; #[objc::msg_send(classificationForIdentifier:)] - pub fn classification_for_id<'a>(&'a self, id: &ns::String) -> Option<&'a Classification>; + pub fn classification_for_id(&self, id: &ns::String) -> Option>; } extern "C" { diff --git a/cidre/src/un/notification_content.rs b/cidre/src/un/notification_content.rs index cce8d998..f52f8d96 100644 --- a/cidre/src/un/notification_content.rs +++ b/cidre/src/un/notification_content.rs @@ -40,15 +40,15 @@ impl NotificationContent { #[cfg(not(target_os = "tvos"))] #[objc::msg_send(body)] - pub fn body(&self) -> &ns::String; + pub fn body(&self) -> arc::R; #[cfg(not(target_os = "tvos"))] #[objc::msg_send(categoryIdentifier)] - pub fn category_id(&self) -> &ns::String; + pub fn category_id(&self) -> arc::R; #[cfg(not(any(target_os = "tvos", target_os = "macos")))] #[objc::msg_send(launchImageName)] - pub fn launch_image_name(&self) -> &ns::String; + pub fn launch_image_name(&self) -> arc::R; #[cfg(not(target_os = "tvos"))] #[objc::msg_send(sound)] @@ -56,22 +56,22 @@ impl NotificationContent { #[cfg(not(target_os = "tvos"))] #[objc::msg_send(subtitle)] - pub fn subtitle(&self) -> &ns::String; + pub fn subtitle(&self) -> arc::R; #[cfg(not(target_os = "tvos"))] #[objc::msg_send(threadIdentifier)] - pub fn thread_id(&self) -> &ns::String; + pub fn thread_id(&self) -> arc::R; #[cfg(not(target_os = "tvos"))] #[objc::msg_send(title)] - pub fn title(&self) -> &ns::String; + pub fn title(&self) -> arc::R; #[cfg(not(target_os = "tvos"))] #[objc::msg_send(userInfo)] - pub fn user_info(&self) -> &ns::Dictionary; + pub fn user_info(&self) -> arc::R>; #[objc::msg_send(targetContentIdentifier)] - pub fn target_content_id(&self) -> Option<&ns::String>; + pub fn target_content_id(&self) -> Option>; #[objc::msg_send(interruptionLevel)] pub fn interruption_level(&self) -> un::NotificationInterruptionLevel; diff --git a/cidre/src/un/notification_request.rs b/cidre/src/un/notification_request.rs index d4b6d7ff..d55c8843 100644 --- a/cidre/src/un/notification_request.rs +++ b/cidre/src/un/notification_request.rs @@ -1,4 +1,4 @@ -use crate::{define_cls, define_obj_type, ns, objc}; +use crate::{arc, define_cls, define_obj_type, ns, objc}; define_obj_type!( #[doc(alias = "UNNotificationRequest")] @@ -9,7 +9,7 @@ impl NotificationRequest { define_cls!(UN_NOTIFICATION_REQUEST); #[objc::msg_send(identifier)] - pub fn id(&self) -> &ns::String; + pub fn id(&self) -> arc::R; } extern "C" { diff --git a/cidre/src/vn/generate_person_segmentation_request.rs b/cidre/src/vn/generate_person_segmentation_request.rs index 3beb9415..15d2372f 100644 --- a/cidre/src/vn/generate_person_segmentation_request.rs +++ b/cidre/src/vn/generate_person_segmentation_request.rs @@ -32,7 +32,7 @@ impl GenPersonSegmentationRequest { pub fn set_output_pixel_format(&mut self, value: os::Type); #[objc::msg_send(results)] - pub fn results(&self) -> Option<&ns::Array>; + pub fn results(&self) -> Option>>; #[objc::msg_send(supportedOutputPixelFormatsAndReturnError:)] #[api::available( @@ -53,8 +53,8 @@ impl GenPersonSegmentationRequest { tvos = 18.0, visionos = 2.0 )] - pub fn supported_output_pixel_formats<'ear>( - ) -> Result>, &'ear ns::Error> { + pub fn supported_output_pixel_formats<'ear>() -> ns::Result<'ear, arc::R>> + { ns::if_none(|err| unsafe { Self::supported_output_pixel_formats_err(err) }) } } diff --git a/cidre/src/wk/web_view.rs b/cidre/src/wk/web_view.rs index 05b15a69..7a11253d 100644 --- a/cidre/src/wk/web_view.rs +++ b/cidre/src/wk/web_view.rs @@ -14,7 +14,7 @@ impl WebView { pub fn set_nav_delegate(&mut self, val: Option<&D>); #[objc::msg_send(title)] - pub fn title(&self) -> &ns::String; + pub fn title(&self) -> arc::R; #[objc::msg_send(isInspectable)] pub fn is_inpectable(&self) -> bool;