• 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
Re: UTI in Lion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UTI in Lion


  • Subject: Re: UTI in Lion
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 21 Sep 2011 11:53:31 -0700

On Sep 21, 2011, at 03:10 , Gerriet M. Denkmann wrote:

> I got from reading the documentation that UTIs are the modern way to go.
>
> NSAttributedString.h says "for reading, thNSFileTypeDocumentAttributes is available along with NSDocumentTypeDocumentAttribute, but for writing the two are mutually exclusive"
>
> So I decided to replace NSDocumentTypeDocumentAttribute in my documentAttributes with thNSFileTypeDocumentAttributes which contain a UTI string.
>
> Previously I had:
>
> 2011-09-21 17:01:46.497 TextEditor[2950:2403] -[TestDocument fileWrapperOfType:error:] will with documentAttributes {
>    CharacterEncoding = 4;
>    DocumentType = NSPlainText;
>    UTI = "public.plain-text";
> }
> - worked fine.
>
>
> But now, with using the UTI stuff I get:
>
> 2011-09-21 16:55:25.551 TextEditor[2897:5203] -[TestDocument fileWrapperOfType:error:] will with documentAttributes {
>    CharacterEncoding = 4;
>    UTI = "public.utf8-plain-text";
> }
> 2011-09-21 16:55:25.553 TextEditor[2897:5203] -[TestDocument fileWrapperOfType:error:] Error Error Domain=NSCocoaErrorDomain Code=66062 "File could not be saved because the specified format is not supported."
>
>
> So - should I just ignore all the hype about UTIs, or what?

It looks like you're mixing up the NSAttributedString "document" type with the NSDocument document type. It doesn't look like they have anything to do with each other.

It also looks like you're doing something wrong  (or, rather, making some wrong assumptions) in an override of 'fileWrapperOfType:error:', but you haven't given us enough information to be sure.


_______________________________________________

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

References: 
 >UTI in Lion (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: how to get rid of NSSavePanel's AccessoryView's border
  • Next by Date: Does an iOS app's UI freeze when going into background?
  • Previous by thread: UTI in Lion
  • Next by thread: Re: UTI in Lion
  • Index(es):
    • Date
    • Thread