Storage Modifiers (Cocoa)
On the Cocoa platform, which uses ARC rather than Garbage Collection for memory management, the three storage modifier keywords __strong
, __weak
and __unretained
are available as extensions to the C# language in order to control how object references are stored in local variables, fields or properties.
By default, all variables and fields are __strong
– that means when an object is stored in the variable, its retain count is increased, and when a variable's value gets overwritten, the retain count of the previously stored object gets reduced by one.
Read more about this topic in the Storage Modifiers topic in the Cocoa platform section.
Cocoa Only
Storage Modifiers are relevant and available on the Cocoa platform only. They can optionally be ignored on .NET and Java when Cross-Platform Compatibility Mode is enabled.
See Also
- Storage Modifiers in the Cocoa platform section
- Storage Modifiers in Oxygene