複製鏈接
請複製以下鏈接發送給好友

ARC

(自動引用計數(Automatic Reference Counting))

鎖定
Automatic Reference Counting,自動引用計數。是蘋果公司的Objective-C程序的一種自動內存管理機制,區別於MRC(Manual Reference Counting)。
中文名
自動引用計數
外文名
Automatic Reference Counting
Automatic Reference Counting,自動引用計數。是蘋果公司的Objective-C程序的一種自動內存管理機制,區別於MRC(ManualReference Counting)。在Objective-C編程中,當對象的引用計數為0時,該對象釋放,否則不釋放,運用ARC可以使編程人員基本不用考慮對象何時釋放的問題,編譯器會在合適的時間自動將其引用計數為零。這樣的機制不僅使代碼更簡單並且使程序更穩定,蘋果官方對其的一句解釋 “Automatic Reference Counting (ARC) is a compiler feature that provides automatic memory management of Objective-C objects. Rather than having to think about retain and release operations, ARC allows you to concentrate on the interesting code, theobject graphs, and the relationships between objects in your application.” [1] 
參考資料