Re: NSString and retain.
Re: NSString and retain.
- Subject: Re: NSString and retain.
- From: "I. Savant" <email@hidden>
- Date: Tue, 12 May 2009 09:19:02 -0400
On Tue, May 12, 2009 at 9:00 AM, Drew Lawson <email@hidden> wrote:
> Maybe I'm just psychic, or it could be because I made a bunch of
> newby mistakes 2-3 months ago, but it doesn't sound meaningless to
> me.
It's meaningless because it does not address what the OP is actually
seeing. Essentially, the term "randomly disappearing" tells fellow
developers nothing in the same way "it crashed" tells us nothing.
Sure, we know somehow something seems to have disappeared or the
application crashed, but without our collective crystal ball, we can
tell the OP nothing in return.
> An object is there and valid, another method and it is still valid,
> another breakpoint and still valid, next breakpoint it is junk. At
> least in managed memory (all I've used for Cocoa), it is a pretty
> standard behaviour for a temporary object that is being kept but
> not retained.
Yes, i.e., a memory-management-related issue (which is the most
likely guess at the OP's problem). Hence the advice to re-read the
docs and, if necessary, rephrase the question to be more specific (so
we have a snowball's chance in hell of being more specific ourselves).
Being a newbie is fine. Not understanding is fine. Not yet having
solid question-asking skills is also fine. Let's not, however, defend
a weak question. Let's instead inform the asker that they need to be
specific with questions about their problems using a complicated
technology. It's not a reflection on the asker, just that strong
technical-question-asking is as much a required skill as any other in
software development and must be developed for obvious practical
reasons.
Respectful pointers to the documentation and an equally-respectful
request for clarification is exactly the right kind of help this
question needs.
> What I didn't get is that it doesn't matter if the method creates,
> allocates, etc. It matters if the method name starts with "alloc,"
> "create," etc.
Ack! Wrong.
As mentioned in the list rules, don't try to paraphrase or rephrase
the memory management rules. It's too easy to get it wrong (like you
just did) and send someone off on a wild goose chase, causing needless
traffic.
Memory Management Rules
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html
If there are specific questions about a specific situation (i.e.,
"what do I do in *this* case with *this* code?"), that's when it's
good to clarify how the rules (or the class reference) applies.
Otherwise, just cite the rules for clarity.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden