On 18 Jul 2012, at 08:09, Lee Ann Rucker wrote:

> In init, and only when they need it. They're all initialized to nil, which is 
> a perfectly reasonable value for an instvar to have; there's very rarely a 
> reason to do anything like
> 
>>    name = [NSString string];
> 
> because sending a method to nil is perfectly safe, unlike C++.
> 
>>    foodLists = [NSMutableArray array];
> 
> is necessary, as you've seen, but not for the reasons you think.

Both of those lines are going to cause random crashes later on because they're 
non-retained objects.

Chris

_______________________________________________

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

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

Reply via email to