Re: aborting init
Re: aborting init
- Subject: Re: aborting init
- From: Graham Cox <email@hidden>
- Date: Tue, 30 Nov 2010 14:27:27 +1100
On 30/11/2010, at 1:59 PM, Rainer Standke wrote:
> The intended behavior is not to get anything if the conditions are not met.
>
>
> Is this kosher? Do I have to do any kind of clean-up after doing something like that?
Yes, it's OK to do this. As it's your own class, you can do what you like - typically you'd just document its behaviour (returns nil if x,y, and z are not met) if anyone else is likely to use it.
The only thing to be concerned with is correct memory management, which just follows the usual rules.
Returning nil, even unexpectedly, is usually 'safe' in that messages to nil are legal, and are either no-ops or return 0, so unlike C++, if you inadvertently send a message to nil, it doesn't crash.
--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