• 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: what am I missing with NSString ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what am I missing with NSString ?


  • Subject: Re: what am I missing with NSString ?
  • From: vinai <email@hidden>
  • Date: Tue, 26 May 2009 07:29:48 -0700 (PDT)


Hi All,

Thanks so much to Micheal, Volker, and esp. to Ken for the pointer/object refresher.

I think my mistake came from thinking that NSString's initWithString method did memory allocation as well, and would create a new object in one swell foop. ;-)  From my own trials and failures, and from what you all are saying - this is definitely not the case.

> However, why are you attempting to init another object, at
> all?  The expression [[files objectAtIndex:i]
> stringByStandardizingPath] returns a pointer to a string
> object, already.  There's a pretty good chance that you
> can just make use of that string object directly.  If
> you need to keep it around, you could retain it and then
> release it later.

This is the approach I tried, and it seems to satisfy my requirement of having the file name available internally to other routines.  I have now encountered other problems further downstream in my pipeline, but c'est la vie ...

Again, thanks all - very, very much!

cheers
vinai




_______________________________________________

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

  • Prev by Date: Re: NSWindow in threads
  • Next by Date: Re: How to check whether a application is launch or not...?
  • Previous by thread: Re: what am I missing with NSString ?
  • Next by thread: Re: what am I missing with NSString ?
  • Index(es):
    • Date
    • Thread