• 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
programmatically setting the file name?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

programmatically setting the file name?


  • Subject: programmatically setting the file name?
  • From: Jérôme Laurens <email@hidden>
  • Date: Thu, 13 Nov 2003 11:42:09 +0100

Hi list

I created in xcode a basic cocoa document based application, with a
delegate:

@implementation delegate
-(void) action: (id) sender;
{
NSDocument * D = [[NSDocumentController sharedDocumentController]
openUntitledDocumentOfType: @"DocumentType" display: YES];
[D setFileName: [NSHomeDirectory() stringByAppendingPathComponent:
@"TEST"]];
[D updateChangeCount: NSChangeDone];
}
@end

The purpose is to create an untitled document and give it
programmatically a new name. The document dataRepresentationOfType
simply returns a void data object.

The problem is that when I save this document, I am asked to give a
file location where to save. If I choose to save as, I see an open
panel exactly at the location ~/TEST!!!

What was my error?
_______________________________________________
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.

  • Follow-Ups:
    • Re: programmatically setting the file name?
      • From: Stéphane Sudre <email@hidden>
References: 
 >How to get a volume free size? (From: Lorenzo <email@hidden>)

  • Prev by Date: How to get a volume free size?
  • Next by Date: Re: Launch crash in strstr... what gives?
  • Previous by thread: How to get a volume free size?
  • Next by thread: Re: programmatically setting the file name?
  • Index(es):
    • Date
    • Thread