>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?

Fritz is spot on.  In addition, note that forms 2 and 3 are only the same under 
the ARC memory model, and is only the case for pointers to Obj-C objects.  This 
is a very new change to Obj-C.

Sean



_______________________________________________

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