• 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: saving rtf data in non-document based app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: saving rtf data in non-document based app


  • Subject: Re: saving rtf data in non-document based app
  • From: Jeremy Dronfield <email@hidden>
  • Date: Sun, 1 Feb 2004 11:48:45 +0000

On 31 Jan 2004, at 9:38 pm, Andrew Kinnie wrote:
I am creating an application which has no real reason to be document-based. However, I want the app to create reports that I want to save. I realize I can implement NSCoding to do normal archiving and unarchiving. However, what I'd like to do is to have the app be able to save its data as it goes along, but let the user create rtf reports that can be read in a text editor.

Assuming the RTF you want to save consists of the contents of an NSTextView, you can write the data straight to file from the view:

if (![myTextView writeRTFDToFile:myFilePath atomically:YES]) {
NSRunAlertPanel(@"Couldn't save file.", @"The file might be protected.", @"OK", nil, nil);
}

That should do it. How you handle the file path is up to you.
Hope this helps.
-Jeremy

========================================
email@hidden

theLocustFarm.net:
- fractious fiction at http://freespace.virgin.net/jeremy.dronfield
========================================
_______________________________________________
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.

  • Prev by Date: Re: Binding questions (style)
  • Next by Date: Re: Moving focus to an NSTextField.
  • Previous by thread: Re: isight picture window
  • Next by thread: Re: Moving focus to an NSTextField.
  • Index(es):
    • Date
    • Thread