| Article: |
Memory Management in Objective-C | |
| Subject: | Really good treatment | |
| Date: | 2001-07-28 09:55:23 | |
| From: | canyonrat | |
| This is a very good intro to a complex subject. I just wish the article were longer. Retain vs copy might be a good subject for a follow-up piece. | ||
Showing messages 1 through 1 of 1.
-
Really good treatment
2001-07-28 19:50:32 chaoswerks [View]
Here's a simple guide for retain or copy. Use retain when the object represents a relationship. Use copy when the object represents a value. The difference is this: in a relationship, if the object pointed to changes, you want your variable to reflect this change of state; whereas, with a value, you want the value to remain unaltered if the original object changes unless you explicitly alter your copy.


