• 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
Setting an NSDocument location programmatically (the answer)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting an NSDocument location programmatically (the answer)


  • Subject: Setting an NSDocument location programmatically (the answer)
  • From: Matthew Weinstein <email@hidden>
  • Date: Fri, 25 Mar 2005 09:12:13 -0500

Thought I should share what I've found that works for saving a document programmatically.

newFile = [dc openUntitledDocumentOfType: theType display: YES];
/*
put any manipulations of newFile here
*/
[newFile writeToFile: myLocation ofType: myType];
[newFile setFileName: myLocation];
[newFile saveDocument: nil]; //seems superfluous, but actually sets a whole bunch of internal variables



Matthew Weinstein Associate Professor of Science Education Kent State University 404 J White Hall Kent, OH 44242

email@hidden
330 672-0653

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: using apple material?
  • Next by Date: NSDocumentController currentDirectory is nil
  • Previous by thread: Re: Don't trust -fileExistsAtPath:isDirectory: when symlinks are involved
  • Next by thread: NSDocumentController currentDirectory is nil
  • Index(es):
    • Date
    • Thread