• 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: NSError: why returned directly?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSError: why returned directly?


  • Subject: Re: NSError: why returned directly?
  • From: Jim Correia <email@hidden>
  • Date: Wed, 26 Apr 2006 13:40:38 -0400

On Apr 26, 2006, at 11:58 AM, William Bumgarner wrote:

Left unchanged. This is the one key area that developers screw up pretty consistently when first faced with NSError**. The rules:

It is also worth noting an additional "rule" which must be followed. It is really nothing that isn't ordinary Cocoa memory management, but might be easily overlooked when dealing with errors returned by reference or raised exceptions. (And since the error/exception path isn't the normal one, likely to escape initial testing.)


If you are using nested autorelease pools, and an NSError or exception is generated within an interior autorelease pool, you must ensure that the error or exception gets promoted to the outer pool as you unwind.

Chris Hanson wrote about this a while ago, with examples.

http://chanson.livejournal.com/126035.html

Jim
_______________________________________________
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


  • Follow-Ups:
    • catches in @catches (was: NSError: why returned directly?)
      • From: Ondra Cada <email@hidden>
References: 
 >Re: NSError: why returned directly? (From: Erik Buck <email@hidden>)
 >Re: NSError: why returned directly? (From: Jonathon Mah <email@hidden>)
 >Re: NSError: why returned directly? (From: William Bumgarner <email@hidden>)

  • Prev by Date: Re: NSError: why returned directly?
  • Next by Date: how do I put ints in for NSUserDefaults for keys?
  • Previous by thread: Re: NSError: why returned directly?
  • Next by thread: catches in @catches (was: NSError: why returned directly?)
  • Index(es):
    • Date
    • Thread