• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Debugging retainCount
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Debugging retainCount
      • From: publiclook <email@hidden>
References: 
 >Re: Debugging retainCount (From: David P Henderson <email@hidden>)

  • Prev by Date: Lighthouse Applications as Free Software -- Progress with Sun
  • Next by Date: TIFFs on pasteboard losing alpha when pasted into Carbon apps
  • Previous by thread: Re: Debugging retainCount
  • Next by thread: Re: Debugging retainCount
  • Index(es):
    • Date
    • Thread