Re: Memory Management question
Re: Memory Management question
- Subject: Re: Memory Management question
- From: j o a r <email@hidden>
- Date: Tue, 28 Mar 2006 20:18:03 +0200
On 28 mar 2006, at 00.21, Paul Lynch wrote:
I assume that you transposed 2 and 1, as I came to the same reasons
as you but for the other numbers. 1 calls stringWith..., 2 uses
alloc/init, then return autorelease.
You assume correctly! Please file it under Doh!
There's nothing wrong with serialising via strings, if you can get
extra use out of the format - like debugging information. In which
case, I'd go with overriding description. I know that someone a
couple of weeks ago had a problem with using description in some
circumstances, but this seems an example where it would suit.
I wouldn't use "-description" for this, unless it's very clearly
documented that you're using it for this purpose. I think it's better
to have a separate method with a name that makes it clear that it
returns a value that is used for serialization. If you use "-
description" you (or your colleagues) might get the impression that
it's only used for debugging output, and that it can be changed
without side effects - like in this case possibly breaking
compatibility with archived objects.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden