Skip to content

Commit

Permalink
Rename NSArray and NSDictionary methods to better match std naming
Browse files Browse the repository at this point in the history
Also add a few bound checks since throwing exceptions from Objective-C is still UB
  • Loading branch information
madsmtm committed Oct 4, 2021
1 parent 634ddac commit 1b122f7
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 142 deletions.
6 changes: 3 additions & 3 deletions objc2_foundation/examples/basic_usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() {
for obj in array.object_enumerator() {
println!("{:?}", obj);
}
println!("{}", array.count());
println!("{}", array.len());

// Turn the NSArray back into a Vec
let mut objs = NSArray::into_vec(array);
Expand All @@ -33,6 +33,6 @@ fn main() {
let keys = &[&*string];
let vals = vec![obj];
let dict = NSDictionary::from_keys_and_objects(keys, vals);
println!("{:?}", dict.object_for(&string));
println!("{}", dict.count());
println!("{:?}", dict.get(&string));
println!("{}", dict.len());
}
Loading

0 comments on commit 1b122f7

Please sign in to comment.