Re: question about identifying old apps
Re: question about identifying old apps
- Subject: Re: question about identifying old apps
- From: Sean McBride <email@hidden>
- Date: Fri, 16 Sep 2011 14:41:53 -0400
- Organization: Rogue Research Inc.
On Fri, 16 Sep 2011 19:14:35 +0800, Rick C. said:
>This might seem a bit outdated but it's useful for my work...regarding
>old ppc apps (I'm assuming ppc but could be classic) there are some that
>are not bundles and also they do not carry the .app extension. However
>in Finder they do show Application under the Kind field. My question
>would be how can I confirm these as apps via code? Since they are not
>bundles and they do not carry the .app extension I'm not quite sure. Thanks!
Here's an NSURL category method that tests if the receiver conforms to a given URL. You could use it with kUTTypeApplication.
- (BOOL)doesConformToUTI:(CFStringRef)inUTI
{
Boolean conforms = false;
NSError* error = nil;
NSString* fileUTI = nil;
BOOL success = [self getResourceValue:&fileUTI
forKey:NSURLTypeIdentifierKey
error:&error];
if (success && fileUTI)
{
conforms = UTTypeConformsTo ((CFStringRef)fileUTI, inUTI);
}
return (conforms ? YES : NO);
}
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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