• 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
overriding documentForFileName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

overriding documentForFileName


  • Subject: overriding documentForFileName
  • From: Tom Gray <email@hidden>
  • Date: Fri, 19 Sep 2003 12:41:54 -0400

Hello,

I need to override NSDocumentControllers documentForFileName:fileName method so that my subclass of NSDocumentControllers will return a different document. it is not really clear to me what I should return. The header files says:

- (id)documentForWindow:(NSWindow *)window;
- (id)documentForFileName:(NSString *)fileName;
// These allow finding the document that corresponds to a window or file

and the documentation says:

documentForFileName:

- (id)documentForFileName:(NSString *)fileName

Returns the NSDocument object for the file in which the document data is stored. The fileName argument is a fully qualified path in the file system. Returns nil if no document can be found.


I guess what I am asking is how do I return an "id" for the document I want to have returned? Do I instantiate one? (alloc/init)

Tom
_______________________________________________
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: .doc to .rtf ?
  • Next by Date: Re: .doc to .rtf ?
  • Previous by thread: Re: .doc to .rtf ?
  • Next by thread: Why would FileManager fail?
  • Index(es):
    • Date
    • Thread