ValueType包装器的垃圾回收(Garbage collection for ValueType wrappers)
从ValueType类的MSDN链接引用
在需要值类型像对象一样行为的情况下,使值类型看起来像引用对象的包装器将分配到堆上,并将值类型的值复制到其中。 包装器被标记,所以系统知道它包含一个值类型。
这意味着我的代码就像“integerVariable.ToString();” 创建的包装对象允许使用此方法以及类似System.Object的所有其他方法。
这种理解是否正确?
这些对象与“常规”对象有何不同?
这个对象的垃圾收集是不同的? 如果是,如何?
提前致谢。
Quoting from the MSDN Link for ValueType Class
In cases where it is necessary for a value type to behave like an object, a wrapper that makes the value type look like a reference object is allocated on the heap, and the value type's value is copied into it. The wrapper is marked so the system knows that it contains a value type.
This means when I code like "integerVariable.ToString();" a wrapper-object created allows using this method and similarly all the other methods of System.Object.
Is this understanding correct?
How are these objects different from the 'regular' objects?
Is the Garbage Collection different for such object? If yes, how?
Thanks in advance.
原文:https://stackoverflow.com/questions/415995
最满意答案
This is not perfect, but it works great (tried on iPad 2). If anybody wants to improve the dynamic though, be my guest. I suck at it.
Hope it suits your needs
相关问答
更多-
看这里: http://www.sencha.com/forum/showthread.php?142107-image-upload 或者在这里: http://www.sencha.com/learn/a-sencha-touch-mvc-application-with-phonegap/ http://zacvineyard.com/blog/2011/03/25/upload-a-file-to-a-remote-server-with-phonegap/ Look here: http://ww ...
-
如何使用Sencha Touch 2实现Pinch to Zoom?(How to implement Pinch to Zoom using Sencha Touch 2?)[2022-06-22]
我们通过在项目中包含iScroll.js解决了这个问题。 有关其文档,请参见http://iscrolljs.com/#zoom 。 它对我们很有效,但它需要一些时间来正确设置。 We have solved this by including iScroll.js in the project. See http://iscrolljs.com/#zoom for its documentation. It's working nicely for us however it required some ... -
我解决了! 我查看了Sencha-2.2源代码,发现selectfield从textfield selectfield扩展而来。 我在我自己的类areaselectfield复制了selectfield源,并且只更改了两行: extend: 'Ext.field.TextArea', xtype: 'areaselectfield' 也许有更简单的方法,但它的工作原理 I solved it! I looked through Sencha-2.2 sources and found that selec ...
-
以下是您如何使用Sencha Touch实现该布局: 不幸的是,这很难解释,但希望它是有道理的。 我还创建了这个布局的一个非常简单的例子,可以在这里看到: http : //www.senchafiddle.com/#jxiA8 (确保你按下Run )。 至于哪些对象/组件; 他们都将是Ext.Containers 。 理想情况下,您将使用MVC结构为每个这些项目创建自定义类(这将扩展Ext.Container)。 这对于Sencha Touch来说绝对是一个很好的用例。 创建这样的丰富应用程序非常棒。 H ...
-
为了实现这一点,您可以使用Ext.Menu并将其安装在左侧或右侧。 对于此功能,您不需要第三方库,它已包含在Sencha Touch中。 http://docs.sencha.com/touch/2.3.0/#!/api/Ext.Menu In order to achieve this you can use Ext.Menu and mount it on the left or right side. You don't need third party library for this featur ...
-
Sencha Touch 2 Grid(Sencha Touch 2 Grid)[2023-02-09]
最适合您的选择是TouchTreeGrid: https : //github.com/swluken/TouchTreeGrid The best option for you will be TouchTreeGrid: https://github.com/swluken/TouchTreeGrid -
了解Sencha Touch语法(Understand Sencha Touch syntax)[2022-08-16]
Sencha Touch是Javascript。 它是用JS编写的,图书馆里没有什么魔力。 如果你了解JS,你应该能够理解Sencha Touch。 Sencha Touch和JQuery是解决相同问题的非常不同的方法。 Sencha Touch使用面向对象的编程概念远远超过jQuery。 同样,有些东西非常相似。 在jQuery中工作了很长时间后,在接近其他Javascript库时需要有一个开放的头脑,因为jQuery没有遵循不同的概念。 图书馆也针对不同的“利基”。 我会说Sencha Touch更像是 ... -
这并不完美,但效果很好(在iPad 2上试过)。 如果有人想改善动态,请成为我的客人。 我很糟糕。 谟 工作实例 希望它适合您的需求 This is not perfect, but it works great (tried on iPad 2). If anybody wants to improve the dynamic though, be my guest. I suck at it. Projet Working Example Hope it suits your needs
-
看看https://github.com/mitchellsimoens/Ext.ux.touch.grid这是Sencha Touch的网格实现。 have a look at https://github.com/mitchellsimoens/Ext.ux.touch.grid This is a grid implementation for Sencha Touch.
-
使用Sencha Touch中的图像处理不同的分辨率触摸设备(Working with images in Sencha Touch for different Resolution Touch Device)[2022-07-25]
1)为简单起见,我个人认为每个整体平台(Android,iPhone,Blackberry)使用最高分辨率/大小。 手机将相应地缩放图像。 它只是让事情更简单; 我不介意的唯一原因是,如果你有一个真正庞大的总图像大小,优化是> 10mb之间的差异。 每当手机必须缩放任何图像时,显然会有轻微的性能损失,但最终对我来说并不明显。 2)Sencha支持视网膜显示。 只要您使用足够高分辨率的图像,它就会被正确缩放。 当然,请确保包含视网膜显示闪屏和应用程序图标 。 1) For simplicity's sake, ...