Finally, I understand whether I should free the object and how to save as few delays in the trivial application as possible (knowing whether the object returns with an additional “save” already called or not). Therefore, NARC rules work very well in this regard.
On the other hand, I cannot wrap my head in retain(usually storing properties) or just instance variables assign. Are there any rules of thumb there? I only know two:
retain
assign
dealloc
But I do not understand if I should save the material that I transferred from another copy. I know that the risk is that the number of deductions is reduced to zero, and I leave the bag (or leave a lot of additional amounts and memory), but ... how can I organize my application so that this does not happen?
I saw some related questions , but nothing in common.
While I am here: What can I say about things that have been added to UIWindowor UIViewthat I personally do not save? If their supervisor is removed from all supervisors, will the "natural" instances be freed to be saved?
UIWindow
UIView
. , , ? - , . , , , .
, ( ) .
, . - . , A B, B A. A B B A, dealloc, . , - . .
, node , . , , , . , , , .
, . , / . , ( ). " ".
, , , NSCopying, , . Cocoa - NSDictionary. , . NSDictionary .
, , , ( ), ... , t ?
: Cocoa . - , , . - , , .
, :
copy
, retain copy released.
released
(, init), dealloc.
, , , :
, - , . , .
Source: https://habr.com/ru/post/1755221/More articles:Xerces-C ++ DOM node row / column location - c ++I18n website: how can I determine the language? - browserIntel 8086 Assembly - Squaring a Register - assemblyHow to end sessions after a certain amount of time in PHP? - phpASP.NET Form Validation Script - c #Creating an SSH connection in a program? - cIs there a semantic difference between element property syntax and atrribute attribute syntax? - c #Is Python-based software less professional than C ++ / compiled software? - c ++ASP.NET MVC authentication cookie - asp.netJava: изменение свойств системы через среду выполнения - javaAll Articles