2 NSDocuments with nib and info.plist problem
2 NSDocuments with nib and info.plist problem
- Subject: 2 NSDocuments with nib and info.plist problem
- From: René van Amerongen <email@hidden>
- Date: Fri, 28 Jan 2005 19:37:48 +0100
Hello everybody
After I did try to find it by myself using the docs and search this
list to find a solution I will hope to find some help from this list.
I have created a Doc bases application and added a second MyDocument2
NIB ( did duplicate the MyDocument.nib and added to the project ).
Renamed the myDocument class to myDocument2. Did check for the
connections and created the files into the project.
Also did rename the nib name.
- (NSString *)windowNibName
{
// Override returning the nib file name of the document
return @"MyDocument2";
}
No compiling errors.
My info.plist dump
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>rtf</string>
</array>
<key>CFBundleTypeIconFile</key>
<string></string>
<key>CFBundleTypeName</key>
<string>DocumentType</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>RTF </string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<false/>
<key>NSDocumentClass</key>
<string>MyDocument</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>txt</string>
<string>text</string>
</array>
<key>CFBundleTypeIconFile</key>
<string></string>
<key>CFBundleTypeName</key>
<string>DocumentType</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<false/>
<key>NSDocumentClass</key>
<string>MyDocument2</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>2DocumentApp</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.apple.myApp</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
The strange thing is that the first dict item in the array decides what
kind of files I could get loaded and will open the correct new and the
corrent nib + window.
In the above plist, it wil let me open rtf files. If I move the rtf
dict downwards, moving the txt dict up then it let me load the txt
files.
Did I mis something, I was thinking that the info.plist gives the
NSDocumentController enough information to open the right NIB
Somebody has informatioon for me about this?
Thanks
Rene
_______________________________________________
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