On Jan 20, 2011, at 8:51 PM, Eric Gorr wrote:
> On Jan 20, 2011, at 4:27 PM, Corbin Dunn wrote:
[...]
>> Yes, please do file a bug. The sample should set the delegate/datasource to 
>> nil, as it is good practice to do so, and we can update the sample.
> 
> Bug filed:  rdar://8896270

I just submitted rdar://8896532, referencing Eric's bug, suggesting that before 
nilling out the delegate and dataSource, you should check whether they are == 
self.  Conceivably at some point the delegate and/or dataSource might have been 
set to some other object -- probably not in this example, but in general.  
Admittedly it's probably very rare that this is an issue, and I'd be surprised 
if anyone on this list has ever run into a bug because of it.  On the other 
hand, if you're going to program defensively, why not go all the way?  On the 
*other* hand, maybe this is one of those things that should be at the 
programmer's discretion rather than a hard and fast rule.

--Andy (just now realizing I haven't been checking for == self myself)

_______________________________________________

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