Re: Trouble using createFileAtPath method to create file
Re: Trouble using createFileAtPath method to create file
- Subject: Re: Trouble using createFileAtPath method to create file
- From: "Jaime Rios" <email@hidden>
- Date: Mon, 15 Oct 2007 11:15:16 -0400
Oh, and thanks for the memory leak tip!
--
-Jaime
http://www.jaimerios.com
On 10/15/07, Jaime Rios <email@hidden> wrote:
>
> Yes, the "Cleanup At Startup" folder exists prior to me trying to create
> the file.
>
>
> --
> -Jaime
> http://www.jaimerios.com
>
> On 10/12/07, Emanuele ∞ Vulcano <email@hidden> wrote:
> >
> >
> > Il giorno 12/ott/07, alle ore 16:27, Jaime Rios ha scritto:
> >
> > > NSString* pFP = [(NSString*)CFURLCopyPath(sourcePath)
> > > stringByAppendingPathComponent:
> > > (NSString*)fileName];
> >
> > This is bad because it will leak a string. Core Foundation does not
> > follow the same rules as Cocoa; in particular *Copy* functions work
> > like Cocoa's init methods.
> >
> > More correct:
> >
> > NSString* pFPPrefix = [(NSString*) CFURLCopyPath(sourcePath)
> > autorelease];
> > NSString* pFP = [pFPPrefix stringByAppending...];
> >
> > Back to your original problem: does the folder whose path is pFP
> > actually *exist* before you try to create a file in it?
> >
> > - ∞
> >
> >
>
>
_______________________________________________
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