Re: NSString problem
Re: NSString problem
- Subject: Re: NSString problem
- From: Charles Srstka <email@hidden>
- Date: Thu, 2 May 2002 16:06:00 -0500
Additionally, you should set the chemin to this instead of the absolute
path:
NSString *chemin = [NSHomeDirectory()
stringByAppendingPathComponent:@"/Documents/Gestion stock/sortie.txt"];
Then your app will work for whatever user run it, not just cathy.
On Thursday, May 2, 2002, at 10:04 AM, John Haager wrote:
On Thursday, May 2, 2002, at 01:05 AM, Famille GOUREAU-SUIGNARD wrote:
Hi everybody,
is anybody able to explai me why the following script gives me this
error (cocoa application) :
CarApp.app has exited due to signal 11 (SIGSEGV).
- (void) actionExportation: (id)sender
{
NSString *chemin = @"/users/cathy/Documents/Gestion
stock/sortie.txt" ;
NSMutableString *chaine ;
[chaine setString:@""] ;
[chaine appendString:@"tagada"] ;
[chaine writeToFile: chemin atomically : NO] ;
}
You never allocated chaine. You need to add the line:
chaine = [ [ NSString alloc ] init ] ;
right before the setString line.
Many thanks.
Camille
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
-> John Haager <-
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.