Declaring Variables - Setting to nil VS Not Setting?
Declaring Variables - Setting to nil VS Not Setting?
- Subject: Declaring Variables - Setting to nil VS Not Setting?
- From: Chris Tracewell <email@hidden>
- Date: Thu, 26 Apr 2012 13:00:58 -0700
I usually use the sample in line 1 when declaring vars inside my methods.
NSString *theString = [NSString string];
NSString *theString = nil;
NSString *theString;
I thought lines 2 and 3 were the same thing. I was wrong. What is the difference and when do you use the style shown in line 3?
Thanks and pointers to docs are welcome.
--chris
_______________________________________________
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