use icrate::ns_string;
use icrate::objc2::rc::autoreleasepool;
use icrate::Foundation::{NSArray, NSDictionary, NSObject};
fn main() {
let obj = NSObject::new();
#[allow(clippy::eq_op)]
{
println!("{obj:?} == {obj:?}? {:?}", obj == obj);
}
let obj2 = NSObject::new();
println!("{obj:?} == {obj2:?}? {:?}", obj == obj2);
let objs = vec![obj, obj2];
let array = NSArray::from_vec(objs);
for obj in array.iter() {
println!("{obj:?}");
}
println!("{}", array.len());
let mut objs = NSArray::into_vec(array);
let obj = objs.pop().unwrap();
let string = ns_string!("Hello, world!");
autoreleasepool(|pool| {
println!("{}", string.as_str(pool));
});
let _s = string.to_string(); println!("{string}");
let keys = &[string];
let vals = vec![obj];
let dict = NSDictionary::from_keys_and_objects(keys, vals);
println!("{:?}", dict.get(string));
println!("{}", dict.len());
}