• 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: stupid newbie questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stupid newbie questions


  • Subject: Re: stupid newbie questions
  • From: Scott Ellsworth <email@hidden>
  • Date: Fri, 27 May 2005 17:19:09 -0700


On May 27, 2005, at 4:47 PM, Theodore H. Smith wrote:

"File's Owner" is actually the NSDocument, at least for this project. The fact that the nib name is "MyDocument.nib" might have some relation to the fact that my class name is "MyDocument".

Other way around. If you look in the generated MyDocument.m, you see

- (NSString *)windowNibName
{
// Override returning the nib file name of the document
// If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead.
return @"MyDocument";
}


This is what ties the window associated with the document in MyDocument.m to some nib somewhere. Rename the nib file, and you must change this function.

Check out the Info.plist, and you will see that the CFBundleTypes dictionary contains a key-value pair for each document type. Specifically, the NSDocumentClass key tells the system to fire up an instance of MyDocument when a document of that type is created.

Do read the docs mmalcolm indicated.

Scott
_______________________________________________
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


References: 
 >Re: stupid newbie questions (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: [Moderator] Cocoa and list resources
  • Next by Date: Re: Order of NIB loading
  • Previous by thread: Re: stupid newbie questions
  • Next by thread: Window will no longer close
  • Index(es):
    • Date
    • Thread