Answering your question as far as I know. First, what is the difference between saving and copying? What is its significance in link counting?
save - "Indicates that the save should be called on the object when it is assigned .... The previous value is sent a release message." So you can imagine the purpose of an NSString instance (which is an object and which you probably want to keep). Thus, the retention rate is increased by 1.
copy - "Indicates that a copy of the object should be used for the assignment ... The previous value is sent by the release message." Basically the same as saving, but sending is copy, not service. if I remember correctly, the count will also increase by 1.
ok, now in more detail.
Property attributes are special keywords to tell the compiler how to create getters and setters. Here you specify two property attributes: nonatomic, which tells the compiler not to worry about multithreading and save, which tells the compiler to save the passed variable before setting the instance variable.
In other situations, you can use the “assign” property attribute instead of the save, which tells the NOT! Compiler to save the passed variable. Or perhaps the copy property attribute, which before copying, converts a copy of the passed variable.
Hope this helps. I found another entry here that could also help you.
Goal C - Assign, Copy, Save
Hooray! Jose
source share