Re: what am I missing with NSString ?
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