• 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: Objective-C Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C Question


  • Subject: Re: Objective-C Question
  • From: Chris Hanson <email@hidden>
  • Date: Mon, 22 Sep 2003 17:23:15 -0500

On Monday, September 22, 2003, at 05:09 AM, Marcel Weiher wrote:
Precisely. Anyway, gcc 3.3 now has exceptions "built-in", apparently to appease those who think that this "must" be a language feature. Functionally, I have a hard time detecting any difference. Maybe if I squint right...

The @finally clause is convenient. Instead of

NS_DURING {
// something that could raise

// do any necessary clean-up
}
NS_HANDLER {
// handle the exception

// do any necessary clean-up (repeated from the NS_DURING block)
}
NS_ENDHANDLER

you can write

@try {
// something that could throw
}
@catch (NSException *exception) {
// handle the exception
}
@finally {
// do any necessary clean-up
}

Yeah, it's better to not need the clean-up in the first place, but if you do need it it's better to remove the duplication.

-- Chris

--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Mac OS X Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
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: Objective-C Question
      • From: email@hidden
    • Re: Objective-C Question
      • From: Jim Correia <email@hidden>
References: 
 >Re: Objective-C Question (From: Marcel Weiher <email@hidden>)

  • Prev by Date: Re: Objective-C Question
  • Next by Date: Re: Objective-C Question
  • Previous by thread: Re: Objective-C Question
  • Next by thread: Re: Objective-C Question
  • Index(es):
    • Date
    • Thread