Re: Discard all drawing in a UIView
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