• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: do you init your instance variables in init method or outside the class?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Lee Ann Rucker <email@hidden>
  • Date: Wed, 18 Jul 2012 07:19:13 -0700 (PDT)

>> 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.
_______________________________________________

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

  • Follow-Ups:
    • Re: do you init your instance variables in init method or outside the class?
      • From: Jean-Daniel Dupas <email@hidden>
    • Re: do you init your instance variables in init method or outside the class?
      • From: Alex Zavatone <email@hidden>
References: 
 >Re: do you init your instance variables in init method or outside the class? (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: KVG generic enough?
  • Next by Date: Re: KVG generic enough?
  • Previous by thread: Re: do you init your instance variables in init method or outside the class?
  • Next by thread: Re: do you init your instance variables in init method or outside the class?
  • Index(es):
    • Date
    • Thread