当前位置:网站首页>__ Weak and__ The difference between blocks
__ Weak and__ The difference between blocks
2022-07-03 18:47:00 【Kevin writes code】
One 、 __weak Is a weak reference , Use weak The modifier reference count will not increase . The referenced object will be added to a weak_table in , The address of the object will be treated as key,weak The address of the pointer ( The value of the address is the address of the object pointer ) Array as value.
1. Initialize a weak Object or adding a weak reference to an object initializes a weak The pointer points to the address of the object and creates the corresponding weak reference table .
2. When the object is released, it will be transferred from weak_table Get all weak Pointer to an array of addresses , Then traverse the array and empty the array . Then completely empty this element from the table and clean up the records of the object .
Two 、 Use __block The decoration object is block Will not be strongly quoted , And the object is in block Can be changed and reassigned .
__block You can modify objects and basic data types , stay MRC and ARC You can use .__weak Only in ARC And can only decorate objects , stay block Cannot be reassigned .
边栏推荐
- What is SQL get connection
- webcodecs
- Opencv learning notes (continuously updated)
- Read the paper glodyne global topology preserving dynamic network embedding
- Mysql45 lecture learning notes (II)
- [combinatorics] generating function (positive integer splitting | unordered | ordered | allowed repetition | not allowed repetition | unordered not repeated splitting | unordered repeated splitting)
- Database creation, addition, deletion, modification and query
- 多媒体NFT聚合平台OKALEIDO即将上线,全新的NFT时代或将来临
- [combinatorics] exponential generating function (concept of exponential generating function | permutation number exponential generating function = combinatorial number ordinary generating function | e
- [combinatorics] exponential generating function (example 2 of solving multiple set permutation with exponential generating function)
猜你喜欢

SQL custom collation

Ping problem between virtual machine and development board

Add control at the top of compose lazycolumn

4. Load balancing and dynamic static separation
![Bloom filter [proposed by bloom in 1970; redis cache penetration solution]](/img/f9/27a75454b464d59b9b3465d25fe070.jpg)
Bloom filter [proposed by bloom in 1970; redis cache penetration solution]

Raft log replication

Opencv learning notes (continuously updated)

2022-2028 global petroleum pipe joint industry research and trend analysis report

2022-2028 global copper foil (thickness 12 μ M) industry research and trend analysis report

235. 二叉搜索樹的最近公共祖先【lca模板 + 找路徑相同】
随机推荐
Ping problem between virtual machine and development board
Have you learned the correct expression posture of programmers on Valentine's day?
22.2.14 -- station B login with code -for circular list form - 'no attribute' - 'needs to be in path selenium screenshot deviation -crop clipping error -bytesio(), etc
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
The installation path cannot be selected when installing MySQL 8.0.23
How about the Moco model?
235. 二叉搜索樹的最近公共祖先【lca模板 + 找路徑相同】
235. 二叉搜索树的最近公共祖先【lca模板 + 找路径相同】
Change is the eternal theme
my. INI file not found
Suffix derivation based on query object fields
Win 11 major updates, new features love love.
Know what it is, and know why, JS object creation and inheritance [summary and sorting]
CV in transformer learning notes (continuously updated)
Which do MySQL and Oracle learn?
leetcode:11. Container with the most water [double pointer + greed + remove the shortest board]
Boost. Asio Library
Redis cache avalanche, penetration, breakdown
How to quickly view the inheritance methods of existing models in torchvision?
VLAN experiment