Open
Description
For example, the following code:
let mut a: Id<NSString> = INSString::from_str("a");
let mut b: Id<NSString> = INSString::from_str("b");
println!("{} {}", a, b);
mem::swap(a.deref_mut(), b.deref_mut());
println!("{} {}", a, b);
Expected output:
a b
b a
Actual output:
a b
a b
We cannot have the expected output happen, because an NSObject's memory address cannot change after it has been constructed.
Metadata
Metadata
Assignees
Labels
No labels