• 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
Can't get my document type to show up...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can't get my document type to show up...


  • Subject: Can't get my document type to show up...
  • From: Jiva DeVoe <email@hidden>
  • Date: Mon, 29 Dec 2003 12:53:45 -0700

I have a document based application which saves it's documents using
the overridden - (NSData *)dataRepresentationOfType:(NSString *)aType
method. The "aType" is passed the correct type information as set up
in my plist. But no matter what I do to my plist, my document type on
my documents remains "DocumentType" and my custom icon does not get
set. Here's my plist entries, and my code. This fires off the default
"first responder" "saveDocument" action. What am I doing wrong?

<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>myfile</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>MyTestDoc</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>text/xml</string>
</array>
<key>CFBundleTypeName</key>
<string>TestDoc</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TestDocOsType</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>NSDocumentClass</key>
<string>TestDoc</string>
</dict>
</array>

- (NSData *)dataRepresentationOfType:(NSString *)aType
{
NSMutableData *data = [[NSMutableData alloc] init];
NSKeyedArchiver *arc = [[NSKeyedArchiver alloc]
initForWritingWithMutableData:data];
[arc setOutputFormat:NSPropertyListXMLFormat_v1_0];
[arc encodeObject:_myDoc forKey:@"TEST_DOC"];
[arc finishEncoding];
return data;
}

--
Jiva DeVoe
jiva at devoesquared.com
http://www.devoesquared.com

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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: Re: Color Picker Questions
  • Next by Date: Re: Vertical Alignment in NSTextView
  • Previous by thread: Adding a word in a dictionary of the Spelling System
  • Next by thread: Re: Can't get my document type to show up...
  • Index(es):
    • Date
    • Thread