displayNameForType
displayNameForType
- Subject: displayNameForType
- From: Boyd Collier <email@hidden>
- Date: Thu, 8 Dec 2005 12:00:01 -0800
The documentation for displayNameForType: reads
Returns the descriptive name for the document type
(documentTypeName), which is often part of the document’s window
title.
- (NSString *)displayNameForType:(NSString *)documentTypeName
Discussion
This returned value is associated with the NSTypeName key in the
CFBundleDocumentTypes property list. If there is no such value,
documentTypeName is returned.
This seems very clear, but when I try it, all I get is whatever I put
in for documentTypeName, which indicates that "there is no such
value" associated with the NSTypeName key. Here is my code in which
I try to use this method (showing myRTFDocument as the
documentTypeName, but I've tried other strings to no avail) and below
it is what I presume is the relevant section of my plist.
sdc = [NSDocumentController sharedDocumentController];
NSLog(@"the document type %@", [sdc
displayNameForType:@"myRTFDocument"]);
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>rtf</string>
</array>
<key>CFBundleTypeName</key>
<string>myRTFDocument</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>MMTX</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<true/>
<key>NSDocumentClass</key>
<string>MyDocument</string>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
</array>
This is probably a problem because of my rudimentary understanding of
the components of plists, but perhaps also a result of Apple's
somewhat ambiguous documentation. Any help on straightening this out
would be appreciated.
Boyd
_______________________________________________
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