1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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());
}