• 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
Getting filename of just opened document...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting filename of just opened document...


  • Subject: Getting filename of just opened document...
  • From: Oliver Cameron <email@hidden>
  • Date: Sat, 29 May 2004 22:23:08 +0100

Hi guys,

I'm trying to do something special depending on the format of the file a user opens. So in openDocument: I try this:

- (void)openDocument:(id)sender
{
[[NSDocumentController sharedDocumentController] openDocument:self];
NSLog(@"%@", [self fileName]);
if ([[[self fileName] pathExtension] isEqualToString:@"extension"])
{
// Special stuff goes here
}
}

Now the code builds fine, but when I open a document, the NSLog shows that fileName is (null). Now, I realize that it may be null because it doesn't know which fileName you are going to choose. But, fileName does not appear in the run log until after I've chosen the document. Any ideas?

Thanks,
Oliver
_______________________________________________
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: Getting filename of just opened document...
      • From: James DiPalma <email@hidden>
  • Prev by Date: Re: Cocoa Rules - ObjC "evalgelism"
  • Next by Date: Re: Data Source {key value coding-compliant} problem...
  • Previous by thread: Re: Help with NSAffineTransform?
  • Next by thread: Re: Getting filename of just opened document...
  • Index(es):
    • Date
    • Thread