当前位置:网站首页>__ 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 .
边栏推荐
- How many convolution methods does deep learning have? (including drawings)
- What problems can cross-border e-commerce sellers solve with multi platform ERP management system
- G1 garbage collector of garbage collector
- 2022-2028 global scar care product industry research and trend analysis report
- The more you talk, the more your stupidity will be exposed.
- Su embedded training - Day10
- MySQL duplicate check
- 知其然,而知其所以然,JS 对象创建与继承【汇总梳理】
- 2022-2028 global lithium battery copper foil industry research and trend analysis report
- Data analysis is popular on the Internet, and the full version of "Introduction to data science" is free to download
猜你喜欢

G1 garbage collector of garbage collector

Torch learning notes (3) -- univariate linear regression model (self training)

How to quickly view the inheritance methods of existing models in torchvision?

2022-2028 global marking ink industry research and trend analysis report

How to analyze the rising and falling rules of London gold trend chart
![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]

The online customer service system developed by PHP is fully open source without encryption, and supports wechat customer service docking

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

Add control at the top of compose lazycolumn

2022-2028 global copper foil (thickness 12 μ M) industry research and trend analysis report
随机推荐
In addition to the prickles that pierce your skin, there are poems and distant places that originally haunt you in plain life
English grammar_ Adjective / adverb Level 3 - multiple expression
Real time split network (continuous update)
VLAN experiment
English語法_名詞 - 分類
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
Torch learning notes (5) -- autograd
Redis cache avalanche, penetration, breakdown
Leetcode: 11. Récipient contenant le plus d'eau [double pointeur + cupidité + enlèvement de la plaque la plus courte]
Database creation, addition, deletion, modification and query
[combinatorics] exponential generating function (example of exponential generating function solving multiple set arrangement)
Multifunctional web file manager filestash
虚拟机和开发板互Ping问题
简述服务量化分析体系
知其然,而知其所以然,JS 对象创建与继承【汇总梳理】
Recent learning experience
Change is the eternal theme
[combinatorics] generating function (positive integer splitting | unordered | ordered | allowed repetition | not allowed repetition | unordered not repeated splitting | unordered repeated splitting)
php-fpm的max_chindren的一些误区
The installation path cannot be selected when installing MySQL 8.0.23