官术网_书友最值得收藏!

Understanding ARC and Memory Management

Swift has a very particular and almost unique memory management strategy: Automatic Reference Counting (ARC). When using ARC, the compiler will inject memory management code for us, but it's very easy to write poor, leaky code, either on purpose or by accident. In this chapter, we'll cover all of the basics for good memory management in Swift. From its origins in Objective-C, to the pre-ARC era, to today, we'll look at how to properly manage our memory and object life cycles. We'll also explore the powerful tools available with Xcode to track memory usage, leaks, cycles, and other defects, through the inspector and the leaks instrument.

In this chapter, we'll cover the following topics:

  • A brief history of reference counting
  • What is ARC?
  • Debugging memory
  • Leaks, cycles, and dangling references
主站蜘蛛池模板: 天柱县| 渝中区| 巴彦淖尔市| 渝中区| 松潘县| 吉木萨尔县| 马关县| 长泰县| 宜城市| 日喀则市| 延寿县| 宁都县| 铅山县| 盖州市| 宁武县| 连城县| 阿鲁科尔沁旗| 澳门| 蒙阴县| 阿图什市| 丹东市| 金昌市| 长兴县| 中江县| 孝义市| 米林县| 咸宁市| 松江区| 明水县| 中卫市| 梁山县| 荔浦县| 正镶白旗| 莱芜市| 荆门市| 新竹市| 扶余县| 渑池县| 武威市| 沙田区| 隆化县|