Re: Debugging retainCount
Re: Debugging retainCount
- Subject: Re: Debugging retainCount
- From: Stefan Pantke <email@hidden>
- Date: Wed, 16 Jul 2003 03:34:58 +0200
Beginning cocoa some time ago, I disliked this sentence as well.
Compared with
Java's rules (simply forget deallocating, Java does) or C's rules
(allways deallocate,
if you allocated), Obj-C is in fact a bit more complicated.
I think, this rule applies:
- If you use a convenience function
Forget on deallocating, runtime does it
- If using allocation with incremented retain count (explicitly by
retain or implicitly)
Release it
IMHO, strict requirements are generally speaking, a good feature.
Strict requirements
often result in errors found earlier in development processes.
Although I hate getting error messages from the runtime system, I love
to
get error messages (find errors) before I release software ;-)
Am Mittwoch, 16.07.03 um 02:32 Uhr schrieb David P Henderson:
Seriously, how hard is it to understand "... only send release or
autorelease to an object to which you have explicitly sent one of the
following messages: alloc, copy or retain." In other words, if you did
not allocate, copy or retain the object; then, do not try to release
it. IMHO, most of these problems stem from people over thinking this
whole process or poor design.
Dave
--
Chaos Assembly Werks
"The proper office of a friend is to side with you when you are in the
wrong. Nearly anybody will side with you when you are in the right."
- Mark Twain
--
Chaos Assembly Werks
"Imagination is more important than knowledge."
- Albert Einstein
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.