• 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: DockTile sample code, Principal class is "DockTile" ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DockTile sample code, Principal class is "DockTile" ?


  • Subject: Re: DockTile sample code, Principal class is "DockTile" ?
  • From: Fritz Anderson <email@hidden>
  • Date: Sat, 28 Dec 2013 19:42:07 -0600

On 28 Nov 2013, at 5:13 PM, Eden <email@hidden> wrote:

> 	In Apple's "DockTile" sample code there is a an app and a dock tile plug-in.
>
> 	In the DockTilePlugIn-Info.plist, the "Principal class" is valued as "DockTile", but there is no such class-- the class in the source code is "DockTilePlugIn".
>
> 	Isn't that a mistake?  But the thing works anyway?  The name of the bundle is "DockTile.docktileplugin", so... does "Principal class" really refer to the name of the bundle? Regardless, I can change the name of the finder file and it still works.
>
> 	In fact, I can delete the value for "Principal class" and it still works... although I can't be sure the working version of something wasn't cached somewhere...
>
> 	Probably a foolish question, but this is my first time with loadable bundles, I just want to understand...

The setting in Info.plist is a bug. The reason it works is that when -[NSBundle principalClass] can't find a class from Info.plist, it falls back to "the first class loaded," as determined by the link order of the plugin. As the plugin consists of only one class, the fallback happens to be correct.

Documentation bug filed.

	— F


_______________________________________________

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: 
 >DockTile sample code, Principal class is "DockTile" ? (From: Eden <email@hidden>)

  • Prev by Date: Re: UISlider with custom images & narrow thumb
  • Next by Date: Re: Keep sibling view in Responder Chain
  • Previous by thread: DockTile sample code, Principal class is "DockTile" ?
  • Next by thread: Question about adding NSTextView into a zoomed parent view (10.9)
  • Index(es):
    • Date
    • Thread