Difference between revisions of "Using ARC in tweaks"

From iPhone Development Wiki
Jump to: navigation, search
(Fix titleing)
(Fix titleing (again))
Line 1: Line 1:
[['''What is ARC?''']]
+
 
 +
== '''What is ARC?''' ==
 +
 
  
 
ARC (or automatic memory management) is a new way to manage memory in Objective-C, first fully introduced in 2011 with iOS 5. This replaces Objective-C's standard memory model, manual memory management.
 
ARC (or automatic memory management) is a new way to manage memory in Objective-C, first fully introduced in 2011 with iOS 5. This replaces Objective-C's standard memory model, manual memory management.
Line 5: Line 7:
 
While ARC can be very convenient, it can also be used as a crutch. While ARC can be helpful while learning, it is important not to rely on it, and to still be capable of managing memory manually.
 
While ARC can be very convenient, it can also be used as a crutch. While ARC can be helpful while learning, it is important not to rely on it, and to still be capable of managing memory manually.
  
[['''How should I use ARC in tweaks?''']]
+
 
 +
== '''How should I use ARC in tweaks?''' ==
 +
 
  
 
As ARC was first introduced with iOS 5, it is very likely that iOS is written with MMR (citation needed), as it seems unlikely that they would rewrite their entire codebase. For this reason, it is not recommended that you use ARC in any hooks, as it could potentially cause problems -- injecting automatically managed code into a manually managed system simply doesn't sound like a good idea.
 
As ARC was first introduced with iOS 5, it is very likely that iOS is written with MMR (citation needed), as it seems unlikely that they would rewrite their entire codebase. For this reason, it is not recommended that you use ARC in any hooks, as it could potentially cause problems -- injecting automatically managed code into a manually managed system simply doesn't sound like a good idea.
  
 
However, you probably will not encounter any problems using ARC in any custom classes that you create.
 
However, you probably will not encounter any problems using ARC in any custom classes that you create.

Revision as of 17:13, 21 January 2015

What is ARC?

ARC (or automatic memory management) is a new way to manage memory in Objective-C, first fully introduced in 2011 with iOS 5. This replaces Objective-C's standard memory model, manual memory management.

While ARC can be very convenient, it can also be used as a crutch. While ARC can be helpful while learning, it is important not to rely on it, and to still be capable of managing memory manually.


How should I use ARC in tweaks?

As ARC was first introduced with iOS 5, it is very likely that iOS is written with MMR (citation needed), as it seems unlikely that they would rewrite their entire codebase. For this reason, it is not recommended that you use ARC in any hooks, as it could potentially cause problems -- injecting automatically managed code into a manually managed system simply doesn't sound like a good idea.

However, you probably will not encounter any problems using ARC in any custom classes that you create.