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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to