Re: checking if an object's instance exists.
Re: checking if an object's instance exists.
- Subject: Re: checking if an object's instance exists.
- From: daniel <email@hidden>
- Date: Sat, 5 Feb 2005 12:01:44 -0800
I think it's just more work. And work should be avoided at all costs :)
It took me a while to get comfortable with the "everything is inited to
nil, and nil is safe to message" mindset that goes with Cocoa, but it's
in there firm now and I don't deny it. I don't manually initialize
ivars to nil anymore than I check for nil before messaging an object.
Just do it.
Another comparison would be IBOutlet connections. This is something
that is done for you contractually by the environment you're working
in. It might add clarity to add code to your awakeFromNib method to
manually go through and reconnect them all, but it would be a waste of
effort.
Daniel
On Feb 5, 2005, at 10:08 AM, Kevin Ballard wrote:
On the other hand, it's still nice to initialize ivars to null (or
whatever you want their default values to be) in the initializer for
clarity's sake.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden