Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
oligamiq committed Nov 23, 2023
1 parent 2875be6 commit 992f9b8
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions rust/iphone/objc/nick_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,15 @@ impl Debug for NickName {
// https://simlay.net/uikit-sys/master/src/uikit_sys/Users/simlay/projects/uikit-sys/target/x86_64-apple-ios/debug/build/uikit-sys-344536fd54f83e27/out/uikit.rs.html#98727
impl NickName {
pub fn new() -> crate::Result<Self> {
println!("NickName::new()");

Ok(Self(Arc::new(RwLock::new(unsafe {
// Create an instance of the UIDevice class
msg_send![class!(UIDevice), alloc]
}))))
}

pub fn get(&self) -> crate::Result<String> {
println!("NickName::get()");

let device = self.0.read().unwrap();

println!("device: {:?}", device);

let any_class = unsafe { &**device }.class();

let obj: &NSObject = unsafe { &**device };

println!("obj: {:?}", obj);

println!("any_class: {:?}", any_class);

// Get the name property
let current: id = unsafe { msg_send![&**device, name] };

Expand All @@ -56,8 +42,6 @@ impl NickName {
// Convert &CStr to Rust string
let name_str = name_cstr.to_str().unwrap();

println!("name: {:?}", name_str);

Ok(name_str.to_string())
}
}

0 comments on commit 992f9b8

Please sign in to comment.