• 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: Declaring Variables - Setting to nil VS Not Setting?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Declaring Variables - Setting to nil VS Not Setting?


  • Subject: Re: Declaring Variables - Setting to nil VS Not Setting?
  • From: Chris Tracewell <email@hidden>
  • Date: Thu, 26 Apr 2012 13:32:43 -0700

On Apr 26, 2012, at 1:17 PM, Fritz Anderson wrote:

> You should be able to get this from any elementary book about C.

I'm sure you are correct.

>> NSString *theString = nil;
>
> fills it with zero (not a pointer to anything).
>
>> NSString *theString;
>
> and doesn't fill it with anything; the variable contains whatever junk was left in the portion of memory the variable now uses.

Thank you these were excellent answers.
_______________________________________________

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

References: 
 >Declaring Variables - Setting to nil VS Not Setting? (From: Chris Tracewell <email@hidden>)
 >Re: Declaring Variables - Setting to nil VS Not Setting? (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: SMJobBless
  • Next by Date: Re: Declaring Variables - Setting to nil VS Not Setting?
  • Previous by thread: Re: Declaring Variables - Setting to nil VS Not Setting?
  • Next by thread: Re: Declaring Variables - Setting to nil VS Not Setting?
  • Index(es):
    • Date
    • Thread