On Jul 14, 2013, at 9:33 AM, Mike Abdullah <mabdul...@karelia.com> wrote:

> 
> On 14 Jul 2013, at 08:40, Shane Stanley <sstan...@myriad-com.com.au> wrote:
> 
>> On 14/07/2013, at 1:30 PM, Lee Ann Rucker <lruc...@vmware.com> wrote:
>> 
>>> Haven't tried it, but [NSWorkspace isFilePackageAtPath:] looks like what 
>>> you want. If that's not sufficient, there are other things in NSWorkspace 
>>> that test files.
>> 
>> The problem, though, is that a file wrapper doesn't have a path.
> 
> I think you have a couple of options, neither terribly satisfactory:
> 
> A) Use the .filename property to work your way through the wrappers and build 
> up the expected URL/path of the file. Then query that to know if it's a 
> package.

This sounds like the correct approach to me. Grab the file extension, call 
UTTypeCreatePreferredIdentifierForTag to convert it to a UTI, then call 
UTTypeConformsTo (or -[NSWorkspace type:conformsToType:]) to determine if the 
type confirms to kUTTypePackage.

--Kyle Sluder

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to