Re: 2 NSDocuments with nib and info.plist problem - Solved
Re: 2 NSDocuments with nib and info.plist problem - Solved
- Subject: Re: 2 NSDocuments with nib and info.plist problem - Solved
- From: René van Amerongen <email@hidden>
- Date: Sun, 30 Jan 2005 09:30:41 +0100
Goodmorning
I did found where the problem was this morning.
My CFBundleTypeName was the problem. I did use the same name for all
the docs types, but it should be unique per document type. I was sure
that I did append a 2 behind the name to make it unique. Apperently
not.
Thanks for the replies on and off list.
René
Op 29-jan-05 om 23:13 heeft Jonathan Jackel het volgende geschreven:
Have you hooked up the window outlet of your NSDocument subclass to
the main window in your nib? I got similar symptoms when I forgot to
do so.
Jonathan
On Jan 29, 2005, at 4:05 AM, René van Amerongen wrote:
Hello
I did get replies from others who where misunderstanding my problem.
They thought that my new document was a issue. This is working
correctly. I also do have code which let me choose the type of
document to create as a new document with the right nib file opened.
My problem is still the same, how do I have to configure the
info.plist to open the right nib.
I know the first is used as a kind of default, but it looks like it
ignores the others completly.
Do I use the wrong CFBundleTypeName, where do I have to set this one
in my NSDocument subclass, or...
Can somebody helps me to make it work, please.
Thank you
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:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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