且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么绑定到结构不起作用?

更新时间:2022-04-21 03:47:53

您的绑定获得了 struct 的副本,因为结构是按值传递给方法的.如果绑定更新了一些东西;内存中某处的副本正在被修改,因此您的原始对象没有更新.

Your binding gets a copy of struct since structs are passed by value to methods. If the binding updates something; a copy in memory somewhere is being modified and hence the original object of yours is not updated.