• 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: How packages are recognized...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How packages are recognized...


  • Subject: Re: How packages are recognized...
  • From: Andrew Merenbach <email@hidden>
  • Date: Tue, 7 Aug 2007 07:38:01 -0700

One way is to use a UTI in your program's Info.plist, such as the following:

	<key>CFBundleDocumentTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeExtensions</key>
			<array>
				<string>chemtool</string>
			</array>
			<key>CFBundleTypeIconFile</key>
			<string>bundle</string>
			<key>CFBundleTypeName</key>
			<string>ChemBuddy Tool PlugIn</string>
			<key>CFBundleTypeRole</key>
			<string>None</string>
			<key>LSTypeIsPackage</key>
			<true/>
		</dict>
	</array>

Although my program ChemBuddy never was a document-based application, these entries in the Info,plist file made it recognize that the files with a "chemtool" path extension were to be interpreted as / creations/ of ChemBuddy's. The "CFBundleTypeRole" > "None" bit ensures that the program knows that ChemBuddy neither views nor edits the plugins. The icon file part also allows the icon to be set without setting it manually in the Finder.

I have since moved away from a plugin-based architecture, but the above is what I used to use.

Cheers,
	Andrew

On Aug 7, 2007, at 7:17 AM, Eric Gorr wrote:

(not sure what the best mailing list for this question would be...)

I am trying to get a better understanding of how the finder determines when to treat a folder as a package.

Basically, if a folder has a .app or .mdimporter extension, the finder takes that as a hint that it should not be treated as a normal folder. For example, the user needs to use 'Show Package Contents' in order to see what it contains.

On this page

http://developer.apple.com/documentation/CoreFoundation/Conceptual/ CFBundles/Concepts/BundlesAndFinder.html

it states that

  The Finder identifies packages by any of the following mechanisms:

The directory has a known extension: .app, .bundle, .framework, .plugin, .kext, and so on.

Although, I noticed that while I can give a folder a .app or .mdimporter extension to turn it into a package, .framework will not do the same - I'm assuming this is an error in the document. All the other extensions listed did turn a folder into a package. Other then .mdimporter, for example, what else does 'and so on' refer to?


The page also lists two other way the finder detects a folder as a package


The directory has its bundle bit set
The directory has a known structure type indicating it is a modern or versioned bundle.


For 'The directory has its bundle bit set'...it seems I should know what this is referring to, but my mind is drawing a blank. How would one set the bundle bit of a folder to turn it into a package?

For 'The directory has a known structure type indicating it is a modern or versioned bundle'...what is/are these structures? I assume in this case, there is no need for the folder to have a recognized extension.


Thank you.



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40ucla.edu


This email sent to email@hidden

_______________________________________________

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


  • Prev by Date: Re: Problems with NSTabView and Key chain after adding and removing Tabs
  • Next by Date: Re: Integrating Unix scripting in Cocoa app
  • Previous by thread: Re: NSManagedObject temporary instance attribute
  • Next by thread: Re: ScreenSaver Shell?
  • Index(es):
    • Date
    • Thread