Re: Another app's UTI can break your app
Re: Another app's UTI can break your app
- Subject: Re: Another app's UTI can break your app
- From: Seth Willits <email@hidden>
- Date: Wed, 11 Jun 2014 13:06:59 -0700
On Jun 10, 2014, at 8:22 PM, Uli Kusterer <email@hidden> wrote:
> On 10 Jun 2014, at 21:21, Seth Willits <email@hidden> wrote:
>> - (NSString *)typeForContentsOfURL:(NSURL *)url error:(NSError **)outError;
>> {
>> if ([url.pathExtension.lowercaseString isEqual:@"sql"]) {
>> return @"my.uti.type";
>> }
>>
>> return [super typeForContentsOfURL:url error:outError];
>> }
>
> I suppose that this works should be mentioned in your bug. It means Apple could easily fix it by making the default implementation take a first stab at looking up the UTI from your Info.plist instead of from Launch Services.
I did mention this in the bug report.
I presume the default implementation may not be this way already because it's possible that a particular URL may be assigned a specific UTI different from what it may normally be, and thus Cocoa always defers to the file system to determine that. However I don't know if that actually ever happens, and even if it did, it should still look at the app's document UTIs either before asking the file system, or after having not found a readable type.
I'd encourage others to file a report on this topic as well.
--
Seth Willits
_______________________________________________
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