请注意,每个对象引用(obj、rq及wr)都是强引用。
Note that each object reference, obj, rq, and wr, are all strong references.
这样,您将创建一个视图和视图模型之间的强引用。
With this, you create a strong reference between View and ViewModel.
您必须记住,要使用这些类,您就不能保留对对象的强引用。
You must remember that to make use of these classes you cannot maintain a strong reference to the object.
如果你通过值访问了一个实例变量,就对变量建立一个强引用。
If you access an instance variable by value, a strong reference is made to the variable.
此外,这几个新的引用类都表现出比典型的强引用“更弱”的引用形式。
In addition, the new reference classes all represent a "weaker" form of a reference than the typical strong reference.
强可及对象(strongly reachable):可以通过强引用访问的对象。
Strongly reachable: an object that can be accessed by a strong reference.
侦听此事件的对象应保留对其事件处理程序的强引用,以避免对它进行垃圾回收。
Objects that listen for this event should keep a strong reference to their event handler to avoid it being garbage collected.
在引入引用类之前,我们只能使用强引用(strong reference)。
Before the reference classes were introduced, only strong references were available. For example, the following line of code shows a strong reference, obj.
处理软引用之后,弱可及对象的集合被识别——这样的对象上不存在强引用或软引用。
After processing the soft references, the set of weakly reachable objects is identified — objects for which no strong or soft references exist.
而且,内存中的一个对象可以被多个引用(可以是强引用、软引用、弱引用或虚引用)引用。
Furthermore, an object in memory can be referenced by multiple references that could be strong, soft, weak, or phantom. Before proceeding further, let's look at some terminology.
在跟踪之后,垃圾收集器就识别软可及的对象——这些对象上除了软引用外,没有任何强引用。
After the trace, the collector identifies the softly reachable objects — these objects for which no strong references exist but soft references do.
要利用这些引用类,您必须取消对MyObject对象的强引用,方法是将ob j设置为null。
To take advantage of these reference classes, you must break the strong reference to the MyObject object by setting obj to null.
recreateIt()方法将重新创建该对象,但它会被 WeakReference引用,而不是强引用。
The recreateIt() method re-creates the object, but it is referenced by a WeakReference, not a strong reference.
最佳方法就是移除强引用的涉及到的缓存,图片对象,以及其它可以在之后使用时还可以重新创建的数据对象。
The best way to do this is to remove strong references to caches, image objects, and other data objects that can be recreated later.
要让它工作,需要找到另外一个对象,它的生命周期恰好是侦听器的生命周期,并安排它持有对侦听器的强引用,这可不是件容易的事。
For it to work, you need to find another object whose lifecycle is exactly the lifecycle of your listener and arrange for it to hold the strong reference to your listener, which is not always easy.
因此,如果收集器在行 //2在重新创建的对象上施加一个强引用之前运行,对象就会丢失,wr.get()则返回null 。
Therefore, if the collector runs before line //2 attaches a strong reference to the re-created object, the object is lost and wr.get() returns null.
通常,都不希望出现循环引用,因为它们引入了复杂性和强耦合性。
In general, circular references are considered undesirable because they introduce complexity and tight coupling.
弱可及对象(weaklyreachable):不是强可及对象也不是软可及对象,并且能够通过弱引用访问的对象。
Weakly reachable: an object that is not strongly or softly reachable and can be accessed through a weak reference.
软可及对象(softlyreachable):不是强可及对象,并且能够通过软引用访问的对象。
Softly reachable: an object that is not strongly reachable and can be accessed through a soft reference.
虚可及对象(phantomly reachable):不是强可及对象、软可及对象,也不是弱可及对象,已经结束的,可以通过虚引用访问的对象。
Phantomly reachable: an object that is not strongly, softly, or weakly reachable, has been finalized, and can be accessed through a phantom reference.
强类型调用只能在j - typed引用上完成。
Strongly typed invocations can only be done on a j-typed reference.
用一个普通的(强)引用拷贝一个对象引用时,限制referent的生命周期至少与被拷贝的引用的生命周期一样长。
When you copy an object reference using an ordinary (strong) reference, you constrain the lifetime of the referent to be at least as long as that of the copied reference.
实例化之后,它就可以在编译期间以强类型的方式引用Person的持久化属性。
Through such instantiation, it is possible to refer to persistent attributes of Person at compile time, rather than at run time, in a strongly typed manner.
英国大学当中,只有剑桥的研究在被引用方面能进入30强,大学学院、牛津大学和帝国学院在50强之内。
Of UK universities, only Cambridge made the top 30 for research citations, with UCL, Oxford and Imperial in the top 50.
该方法具有代价小,灵活性强的特点,可用来检查程序中指针非法引用、内存泄漏及其他资源泄漏等安全漏洞。
The method can be used to detect safety holes, such as illegal pointer references, memory leaks, and other resource leaks, at a low cost and with high flexibility.
用户应移除多余的引用,重命名其中一个引用,或者为它们提供一个强名称。
The user should remove the redundant reference, rename one of the references, or provide a strong name for them.
因此,具有强名称的程序集只能引用其他具有强名称的程序集。
Therefore, strong-named assemblies can only reference other strong-named assemblies.
此异常在尝试动态访问未通过其强名称引用的程序集中已删除或重命名的字段时生成。
This exception is generated when an attempt is made to dynamically access a deleted or renamed field of an assembly that is not referenced by its strong name.
本书系统地介绍了建筑与风水的微妙的关联,其中引用了许多图片、事例,图文并茂,生动活泼,可读性强。
Vivid and readable, the book, which is with both excellent pictures and texts, inserted many examples and pictures, introduces systemically the delicate relation between geomancy and architecture.
本书系统地介绍了城市与风水的微妙的关联,其中引用了许多图片,事例,图文并茂,生动活泼,可读性强。
Vivid and readable, the book, which is with both excellent pictures and texts, inserted many examples and pictures, introduces systemically the delicate relation between geomancy and city.
应用推荐