• 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: question about identifying old apps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >question about identifying old apps (From: "Rick C." <email@hidden>)

  • Prev by Date: Proper handling of NSSavePanel and 'Do you want to replace it?' dialog
  • Next by Date: Re: question about identifying old apps
  • Previous by thread: Re: question about identifying old apps
  • Next by thread: NSTextField : Tooltip show Whole String, only when Truncated
  • Index(es):
    • Date
    • Thread