Re: Best Practices for Associating a File Extension With a File in XCode 4?
Re: Best Practices for Associating a File Extension With a File in XCode 4?
- Subject: Re: Best Practices for Associating a File Extension With a File in XCode 4?
- From: Lee Ann Rucker <email@hidden>
- Date: Sat, 03 Sep 2011 14:12:52 -0700 (PDT)
Have you set [NSDocument fileType]?
You can get the extension from [NSString pathExtension]
----- Original Message -----
From: "Vik Rubenfeld" <email@hidden>
To: email@hidden
Sent: Saturday, September 3, 2011 12:33:13 PM
Subject: Best Practices for Associating a File Extension With a File in XCode 4?
I see that NSDocument has lots of great support for saving files, including:
[self saveDocumentWithDelegate:self didSaveSelector:@selector(didSaveDocument:didSave:contextInfo:) contextInfo:nil];
NSDocument supports several methods for providing info on the document to be saved, including:
- (NSURL *)fileURL //document's location
- (NSData *)dataOfType: (NSString *)type error:(NSError **)error //document's data
...etc.
But I don't yet see a method that returns the file extension for the file.
Going to the app project settings, I filled in a document type as shown in this image:
http://tinyurl.com/3v6hezq
As shown in the image, I filled in a file extension for documents of the document type, "QuickLookOutputDocument," which is one of my app's objects, a subclass of NSDocument. I thought that perhaps this file extension would be used when the document was saved. However, although the data of the document is saved correctly, using:
[self saveDocumentWithDelegate:self didSaveSelector:@selector(didSaveDocument:didSave:contextInfo:) contextInfo:nil];
...no file extension was used.
What am I missing?
Thanks very much in advance to all for any info._______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden