background preloader

Memoire

Facebook Twitter

5 tips to reduce memory issues in iOS apps. iOS Memory Management Basics. Managing And Optimizing Memory Usage. Loading… Objective-C Dev Programming Tutorial On Memory Management. 9 iPhone Memory Management Links and Resources. Memory management is the process of keeping track of objects in your applications and “freeing” objects that you no longer want to keep around (otherwise nasty memory leaks can occur).

9 iPhone Memory Management Links and Resources

On the Mac, you can optionally allow Objective C to deal with the memory management on your behalf, but as an iPhone developer, it’s a necessary chore – Apple considers automatic memory management to be too performance intensive. We’ve collected together several of the most useful iPhone memory management related resources we could find and linked them below. They’re not all iPhone specific and they range from ultra simple to reasonably complex.. so dive in: Memory Management from Wikipedia - What is memory management? If you’re asking yourself that question (despite the explanation above) check out this solid introduction to the general concepts from Wikipedia. Memory Management with Objective C / Cocoa / iPhone by Mehmet S.

iPhone Memory Management – A Brief Introduction by Mr. Beginning ARC in iOS 5 Tutorial Part 1. This post is also available in: Chinese (Simplified), Polish If you're new here, you may want to subscribe to my RSS feed or follow me on Twitter. Thanks for visiting! Learn the ins and outs of ARC in iOS 5! Update 10/24/12: If you’d like a new version of this tutorial fully updated for iOS 6 and Xcode 4.5, check out iOS 5 by Tutorials Second Edition!

Note from Ray: This is the twelfth iOS 5 tutorial in the iOS 5 Feast! This is a post by iOS Tutorial Team member Matthijs Hollemans, an experienced iOS developer and designer. The most disruptive change in iOS 5 is the addition of Automatic Reference Counting, or ARC for short. Using ARC in your own projects is extremely simple. With Automatic Reference Counting enabled, the compiler will automatically insert retain, release and autorelease in the correct places in your program. In addition, we’ll give you hands-on experience with converting an app that doesn’t use ARC at all to using ARC. How It Works Pointers Keep Objects Alive The App. 10 iPhone Memory Management Tips. Memory management in the iPhone is a hot topic. And since tonight I’m talking about it on tonight’s monthly meetup of the French-speaking Swiss iPhone Developers group, I might as well share some tips here from my own experience.

I won’t go dive through the basics; I think that Scott Stevenson did a great job in his “Learn Objective-C” tutorial at CocoaDevCentral, from where the image below comes. I’m just going to highlight some iPhone-specific issues here and there, and provide some hints on how to solve them. To begin with, some important background information: Having said this, here’s my list of tips: Respond to Memory WarningsAvoid Using Autoreleased ObjectsUse Lazy Loading and ReuseAvoid UIImage’s imageNamed:Build Custom Table Cells and Reuse Them ProperlyOverride Setters ProperlyBeware of DelegationUse InstrumentsUse a Static Analysis ToolUse NSZombieEnabled Respond to Memory Warnings Whatever you do in your code, please do not forget to respond to memory warnings! Use Instruments. ARC. By Paul on September 7th, 2011 in TechnobabbleTags: arc, development, iOS, ios5, xcode Automatic Reference Counting (ARC) largely removes the burden of manual memory management, not to mention the chore of tracking down bugs caused by leaking or over-released objects!

ARC

Despite its awesomeness, ARC does not let you ignore memory management altogether. This post covers the following key aspects of ARC to help you get up and running quickly. Reference Counted Memory: Quick RevisionHow Automatic Reference Counting WorksEnabling ARC in Your ProjectNew Rules Enforced by ARCARC Qualifiers – Declared PropertiesARC Qualifiers – Regular VariablesMigrating Existing Projects to ARCIncluding Code that is not ARC CompliantShould I Use ARC? What Has Changed? In the time before ARC, you had to manually retain/release/autorelease objects to ensure they would “stick around” for as long as you needed them.

Let’s start at the beginning …