Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: The best way to implement memory management?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The best way to implement memory management?



Agreed about looking at GC, if you can target Leopard.

Having said that, IMHO Cocoa's "old-school" retain counting really wasn't *that* big of a problem. Virtually all of the difficulty I've seen people having with it were the result of not following the suggested design pattern, resulting in code that's "polluted with a whole lot of fragile retain/release bookkeeping code."

If you've got bookkeeping code all over the place, then you're doing it wrong. Such code should be isolated entirely in accessors, and those can be generated with Xcode's built-in scripts, or (more flexibly) by something like Accessorizer, or (for >= Leopard) Objective-C's new @property directives.

sherm--

On Thu, Oct 30, 2008 at 11:50 PM, Ian Joyner <email@hidden> wrote:
I don't know what "codes" you've already written, but I'd seriously look at using GC. It will save polluting your code with a whole lot of fragile retain/release bookkeeping code and allow you to write your application instead. Do you need to run pre-Obj-C 2.0 or Leopard?

Ian


On 31/10/2008, at 1:33 PM, Adriano Brandão wrote:

Hi guys,

I've been studying how to manage the memory using the counting reference model. The correct way for doing this (I think) is to implement its techniques while writing each part of the code. But, if I want to implement them in the codes I've already written, what's the best way to go? Is there any graphical representation of what owns what? Or some place in the debug console where I can view the retain values for each of my objects?

Thanks
Adriano
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



--
Cocoa programming in Perl: http://camelbones.sourceforge.net

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >The best way to implement memory management? (From: Adriano Brandão <email@hidden>)
 >Re: The best way to implement memory management? (From: Ian Joyner <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.