• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSString problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: NSString problem (From: John Haager <email@hidden>)

  • Prev by Date: [ANN] ScreenChooser
  • Next by Date: Re: addSubview \ replaceSubview won't support embedded controls
  • Previous by thread: Re: NSString problem
  • Next by thread: Is Apple's UTF-8 decoder safe?
  • Index(es):
    • Date
    • Thread