1extern crate objc_foundation;
2
3use objc_foundation::{NSArray, NSDictionary, NSObject, NSString,
4 INSArray, INSCopying, INSDictionary, INSObject, INSString};
5
6fn main() {
7 let obj = NSObject::new();
9 println!("{:?} == {:?}? {:?}", obj, obj, obj == obj);
10
11 let obj2 = NSObject::new();
12 println!("{:?} == {:?}? {:?}", obj, obj2, obj == obj2);
13
14 let objs = vec![obj, obj2];
16 let array = NSArray::from_vec(objs);
17 for obj in array.object_enumerator() {
18 println!("{:?}", obj);
19 }
20 println!("{}", array.count());
21
22 let mut objs = NSArray::into_vec(array);
24 let obj = objs.pop().unwrap();
25
26 let string = NSString::from_str("Hello, world!");
28 println!("{}", string.as_str());
29 let string2 = string.copy();
30 println!("{}", string2.as_str());
31
32 let keys = &[&*string];
34 let vals = vec![obj];
35 let dict = NSDictionary::from_keys_and_objects(keys, vals);
36 println!("{:?}", dict.object_for(&string));
37 println!("{}", dict.count());
38}