一、 MRC 手動(dòng)管理內(nèi)存(Manual Reference Counting) 1、引用計(jì)數(shù)器 引用計(jì)數(shù)器: 一個(gè)整數(shù),表示為「對(duì)象被引用的次數(shù)」。系統(tǒng)需要根據(jù)對(duì)象的引用計(jì)數(shù)器來判斷對(duì)象是否需要被回收。 關(guān)于「引用計(jì)數(shù)器」,有以下幾個(gè)特點(diǎn): 每個(gè)OC 對(duì)象都有自己的引用計(jì)數(shù)器。 任何一個(gè)對(duì)象,剛創(chuàng)建的時(shí)候,初始的引用計(jì)數(shù)為 1。 即使用 alloc
www.dbjr.com.cn/article/2597...htm 2022-8-18