Re: do you init your instance variables in init method or outside the class?
Re: do you init your instance variables in init method or outside the class?
- Subject: Re: do you init your instance variables in init method or outside the class?
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 18 Jul 2012 17:00:53 +0200
Le 18 juil. 2012 à 16:19, Lee Ann Rucker <email@hidden> a écrit :
>
>>> fly2never wrote:
>>> name = [NSString string];
>>
>>> because sending a method to nil is perfectly safe, unlike C++.
>
>> Ah! No! That's not a blanket guarantee! It is only valid for methods that return void, integer types or pointers. If your method returns a struct and you send it to NIL, you get garbage back.
>
> Yeah, sorry. I was just thinking of the sending part of it which doesn't need the guards against nil that are necessary in C++; using the result is a different matter.
No need to be sorry. You were right. structs are properly handled since LLVM compiler 3.0 (Xcode 4.2).
http://www.sealiesoftware.com/blog/index.html
-- Jean-Daniel
_______________________________________________
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