• 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: Write to a text file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Write to a text file


  • Subject: Re: Write to a text file
  • From: Thomas Lachand-Robert <email@hidden>
  • Date: Mon, 6 May 2002 13:49:48 +0200

Le lundi 6 mai 2002, ` 09:25 , Ben O'Neill a icrit :

Thats helped me, but when I use the below code:

{
NSString *temp = titleField;
[temp writeToFile: @"/ben.txt" atomically: YES];
}

I get this error message:

2002-05-06 17:24:02.948 DVD Manager[1939] *** -[NSTextField writeToFile:atomically:]: selector not recognized

Do you know what is missing?


Your are missing taking care of the compiler warnings. NSString *temp = titleField just copies the reference to the text field in the temp variable, which is now of type NSTextField*, not NSString*, as the compiler certainly told you. Since instances of NSTextField do not respond to writeToFile:atomically:, you get an execution error. If you want to read the content of the field, use
NSString *temp = [titleField stringValue];


Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
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: Write to a text file (From: "Ben O'Neill" <email@hidden>)

  • Prev by Date: Re: Write to a text file
  • Next by Date: Re: Cross Platform Obj-C?
  • Previous by thread: Re: Write to a text file
  • Next by thread: Re: Write to a text file
  • Index(es):
    • Date
    • Thread