开发者

Does GetHashCode() work correctly in MonoTouch for NSObject-derived objects?

开发者 https://www.devze.com 2023-03-16 21:44 出处:网络
I\'m trying to figure out if MonoTouch correctly calls the underlying \"hash\" message when yo开发者_StackOverflowu call GetHashCode() from a NSObject drived object.A quick check of the implementation

I'm trying to figure out if MonoTouch correctly calls the underlying "hash" message when yo开发者_StackOverflowu call GetHashCode() from a NSObject drived object. A quick check of the implementation of GetHashCode() (in MD's assembly browser) for an arbitrary object (NSAttributedString in my example) has it calling object.InternalGetHashCode(), so I suspect it doesn't call "hash". "hash" doesn't appear to be exposed either, which makes me suspect there's another way to get to it. Anyone been down this road before?


Good observation, this is a bug.

I will fix this in MonoMac, and for our upcoming iPhone/.NET product


object.InternalGetHashCode()

... is returned in Assembly Browser for System.Object as well, regardless if it is a MonoTouch or Mono project.

Yes, it works correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消