This is not clear, I don’t care if the UIView is automatically freed from its supervisor, if you use addSubview to add it to another view?!? I know that only ONE supervisor can have an idea, but I don’t quite understand how to move the sub-view from one supervisor to another.
save , release (from the old supervisor), addSubview to the new supervisor
or
just addSubview to the new supervisor?
, -removeFromSuperView, , UIView -removeFromSuperView. , -addSubView: -removeFromSuperView, -removeFromSuperView UIView.
-removeFromSuperView
-addSubView:
-removeFromSuperView . , (, , ) . , , , / .
, .
[subview retain]; // because next line will release [subview removeFromSuperView]; // released by superview [otherSupView addSubview:subview]; // retained by new superview [subview release]; // because you retained it in line 1
, , :
[[theView retain] autorelease]; [theView removeFromSuperview]; [newSuperview addSubview:theView];
If the supervisor is the only object that has a save in the preview, then the subview will be released when it is removed from the supervisor. Saving and abstract guarantee that the view will not be released as long as you use it in a function (because it has additional saving on it).
Source: https://habr.com/ru/post/1712630/More articles:Есть 64-разрядная версия SSMS и BIDS с SQL Server 2008 64 бит? - sql-serverКак создать экземпляр двух классов одновременно? - classConvert PDF to RTF in Java - javaHow to structure a large Ruby application? - ruby | fooobar.comIntegration Services and Identity Columns - sql-serverhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1712631/data-analysis-tool-like-ms-excel&usg=ALkJrhjisv86d3jyqjurplLK2u0fnld0_gРазрешает ли проверка в web.config подгруппы? - authorizationSSL WCF с пользовательской привязкой - silverlight-3.0Structure initialization problem? - cPHP string test and boolean - performanceAll Articles