GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing elements.docs.remobjects.com — Storage Modifiers
Storage ModifiersOn the Cocoa platform, which uses ARC rather than Garbage Collection for memory management, three Storage Modifier keywords are available to control how object references are stored in local variables, fields or properties. By default, all variables and fields are Storage modifiers can be used on type names in:
The
These modifiers are only available for the Cocoa platform and cannot be used in .NET and Java projects unless Cross-Platform Compatibility is enabled, in which case they are ignored on .NET and Java. Strongstrong storage is implied as default whenever referencing types without any of the other two storage modifiers. The following two variable or field declarations therefore are the same:
WeakOptionally, weak references store the object reference without affecting the retain count. In addition, weak references also keep track of the referenced object and automatically will get set to The most common use for weak storage is to avoid Retain Cycles, where one object holds on to another and the second object also references the first.
UnretainedA third type of object references are so-called When the object gets released at a later point in time, an unretained reference will point to stale memory. For this reason, unretained is the most seldom used storage modifier, and should only be used in controlled scenarios when your code has exact control or knowledge about the life cycle of the referenced objects. The upside of unretained is that it has an ever so slight performance benefit over weak.
See Also
| ||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |