RE: createFileAtPath
RE: createFileAtPath
- Subject: RE: createFileAtPath
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Fri, 9 Jan 2004 14:32:04 -0500
This isn't an XCode question. You'll get better help on the cocoa-dev list.
< http://www.lists.apple.com/mailman/listinfo/cocoa-dev>
But here goes.
1. You need to send the message to a file manager, such as [NSFileManager
defaultManager]. I'm surprised your code compiles at all.
2. The method is createFileAtPath:contents:attributes:, not simply
createFileAtPath:.
3. The path argument is an NSString, not a C string enclosed in parentheses.
And it should be a path, not just a file name.
[[NSFileManager defaultManager]
createFileAtPath:[NSHomeDirectory() stringByAppendingPathComponent:
@"pippo.txt"]
contents:data
attributes:dict];
Jonathan
> -----Original Message-----
> From: email@hidden
> [mailto:email@hidden]On Behalf Of Simone
> Gabbriellini
> Sent: Friday, January 09, 2004 12:14 PM
> To: email@hidden
> Subject: createFileAtPath
>
>
> hello!
> anyone there who knows the correct syntax for createFileAtPath? I mean,
> what I need is an example of the code, not the definition (I read it in
> the Apple documentation): let's say I want to write down a file called
> "pippo.txt" when I press a button. I already got this by Interface
> Builder:
>
> - (IBAction)aggiungi:(id)sender
> {
> [createFileAtPath:("pippo.txt")]; // this part doesn't work!!!
> }
>
> thank you so much,
> Simone
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.