• 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: Discard all drawing in a UIView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Discard all drawing in a UIView


  • Subject: Re: Discard all drawing in a UIView
  • From: Graham Cox <email@hidden>
  • Date: Sun, 25 Jul 2010 15:07:42 +1000

On 25/07/2010, at 6:47 AM, Steve Christensen wrote:

>> I am extracting strings from an NSString and I get NSRange exceptions. I could always first check to see if the range is valid, but, figured I would save myself the effort and use the exception handling mechanism.


NO, this is misguided.

Exceptions are meant to indicate a PROGRAMMER error, not a routine runtime situation (clue, they are called exceptions, and so indicate truly exceptional circumstances, not just an edge case you couldn't be bothered to check for). They are expensive, and should not be used for flow control, especially as there is a very simple way to avoid them in this case. If you can avoid using exceptions, always do so.

--Graham


_______________________________________________

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

  • Follow-Ups:
    • Re: Discard all drawing in a UIView
      • From: Malayil George <email@hidden>
References: 
 >Discard all drawing in a UIView (From: Malayil George <email@hidden>)
 >Re: Discard all drawing in a UIView (From: Steve Christensen <email@hidden>)
 >Re: Discard all drawing in a UIView (From: Steve Christensen <email@hidden>)

  • Prev by Date: Re: Nested UIScrollView: horizontal scrolling
  • Next by Date: Re: NSBrowser and double click
  • Previous by thread: Re: Discard all drawing in a UIView
  • Next by thread: Re: Discard all drawing in a UIView
  • Index(es):
    • Date
    • Thread