FROM : Stuart Malin
DATE : Sun Mar 16 18:09:35 2008
Jens,
Thank you for pointing these out. I provided the info I did because I
hadn't seen anyone else reply to Kevin with detailed code
suggestions, but rather, vague suggestions. I stated clearly that my
suggestion was from a Cocoa perspective on how to convert NSString to
bytes, and were only possible starting points. Given my disclaimers,
I expected that either he (Kevin) would handle any CF issues of which
I was unfamiliar, or that others on the list would with greater
knowledge would respond with helpful suggestions, as you have. Again,
thank you for sharing your knowledge in a clear and specific way,
which I notice you do frequently, and with accuracy.
Respectfully,
--Stuart
On Mar 16, 2008, at 5:35 AM, Jens Alfke wrote:
>
> On 15 Mar '08, at 11:49 PM, Stuart Malin wrote:
>
>> 1: I have never worked with CF functions before
>
> Then, with all due respect, you might want to hold off giving
> advice to others until you get some more experience with it. CF can
> be tricky to work with.
>
> (1) Both of your examples leak memory, because you didn't call
> CFRelease on the CFURLRefs you created.
> (2) It would be better to use CFURLCreateWithFileSystemPath to
> create the URL. It avoids the intermediate conversion of the string
> to a C string, and it's specialized for working with file paths
> (which may not be 100% UTF-8.)
>
> —Jens
DATE : Sun Mar 16 18:09:35 2008
Jens,
Thank you for pointing these out. I provided the info I did because I
hadn't seen anyone else reply to Kevin with detailed code
suggestions, but rather, vague suggestions. I stated clearly that my
suggestion was from a Cocoa perspective on how to convert NSString to
bytes, and were only possible starting points. Given my disclaimers,
I expected that either he (Kevin) would handle any CF issues of which
I was unfamiliar, or that others on the list would with greater
knowledge would respond with helpful suggestions, as you have. Again,
thank you for sharing your knowledge in a clear and specific way,
which I notice you do frequently, and with accuracy.
Respectfully,
--Stuart
On Mar 16, 2008, at 5:35 AM, Jens Alfke wrote:
>
> On 15 Mar '08, at 11:49 PM, Stuart Malin wrote:
>
>> 1: I have never worked with CF functions before
>
> Then, with all due respect, you might want to hold off giving
> advice to others until you get some more experience with it. CF can
> be tricky to work with.
>
> (1) Both of your examples leak memory, because you didn't call
> CFRelease on the CFURLRefs you created.
> (2) It would be better to use CFURLCreateWithFileSystemPath to
> create the URL. It avoids the intermediate conversion of the string
> to a C string, and it's specialized for working with file paths
> (which may not be 100% UTF-8.)
>
> —Jens
| Related mails | Author | Date |
|---|---|---|
| Kevin Dixon | Mar 15, 20:04 | |
| Adam R. Maxwell | Mar 15, 20:23 | |
| Jean-Daniel Dupas | Mar 15, 20:25 | |
| Keith Duncan | Mar 15, 20:34 | |
| Adam R. Maxwell | Mar 15, 20:48 | |
| Stuart Malin | Mar 16, 07:49 | |
| stephen joseph but… | Mar 16, 09:11 | |
| Nir Soffer | Mar 16, 10:41 | |
| Jean-Daniel Dupas | Mar 16, 12:09 | |
| Jens Alfke | Mar 16, 16:35 | |
| Stuart Malin | Mar 16, 18:09 | |
| Michael Ash | Mar 16, 19:15 | |
| Adam R. Maxwell | Mar 16, 19:38 | |
| Kevin Dixon | Mar 17, 16:44 | |
| Sean McBride | Mar 17, 17:27 |






Cocoa mail archive

