• 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
newbie questions on NSString* as a class attribute
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

newbie questions on NSString* as a class attribute


  • Subject: newbie questions on NSString* as a class attribute
  • From: Wayne Shao <email@hidden>
  • Date: Tue, 21 Apr 2009 17:53:07 -0700

Let's say that I have a member variable   NSString* logFilePath, I do init
in the   initWith.... method as
    logFilePath = [[some_other_path stringByAppendingPathComponent:@"log.txt"]
copy];

The question is, if I do not call copy, is it true that logFilePath could be
subject to be GC'ed?

Another question, if I have the  @" " string assigned to a global constant,
is it true that I do not need to copy in that case?

TIA,
Wayne
_______________________________________________

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: newbie questions on NSString* as a class attribute
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Re: How do you get the font used in a menu item?
  • Next by Date: Re: How do you get the font used in a menu item?
  • Previous by thread: Re: How do you get the font used in a menu item?
  • Next by thread: Re: newbie questions on NSString* as a class attribute
  • Index(es):
    • Date
    • Thread