Xcode plugin and the missing XCPluginHasUI Info.plist key

Creating a Xcode plugin project with basic things go well, except some thing with finding menu items, but thats another topic.

However I noticed that in my console the line pops up:
The Xcode plugin at path /Users/rva/Library/Application Support/Apple/Developer Tools/Plug-ins/menuttest.pbplugin is missing the XCPluginHasUI Info.plist key, it is assumed to have UI and will not be loaded by Xcode.
What is this realy meaning?: it is assumed to have UI and will not be loaded by Xcode
Is popping up a dialog having a UI, and what is not loading? I do get my dialogs e.t.c. For now didn’t use any GUI elements.

How unhealty is this? How can I supply a Info.plist? I mean what should be in there? Why is it not there already?

How do other people solve this?

In xcode in the groups&files list, your resources folder will have an info.plist file. All cocoa bundles have one by default in xcode, so it’s there… somewhere. If the “XCPluginHasUI” entry is not there, you can add the key/value pair yourself. In the latest version of xcode it’s provided for you by default when you create the project. I think on older versions of xcode it was not added automatically, though. If you double click the file and it opens as a text file, just add…

<key>XCPluginHasUI</key> <string>YES</string>
If it opens in plist editor, then cilck on an item in the list of entries and click the “new sibling” button, then modify the new entry so it has a name of “XCPluginHasUI” and a value of “YES” (making sure that you set the value as a string, not a boolean).

It just means that xcode expects to see this k/v pair in your plist so it knows whether it’s supposed to dedicate resources and load your bundle with the intention of integrating it into it’s own ui. When you load a bundle (an xcode plugin) it becomes part of the application. It’s not it’s own entity, really, so xcode wants to know how exactly to commit to your bundle.

No, dialogs are not a UI. Not by the definition created by the context of this error.

What is not loading is nothing. If you don’t have a ui, then it obviously won’t try to load it. :wink: If you add a nib file, it may not get loaded. If you don’t plan to use a UI in your plugin, you probably want to add the XCPluginHasUI anyways, and pass a value of “NO” so xcode knows it doesn’t even need to try to load a UI from your bundle.

However you and I and the small handful of other people making xcode plugins do it. Xcode plugins are poorly documented and there aren’t many people making them. You won’t find a lot of people with direct expereince with them. See my signature below for a link to my Chronicle plugin (which is currently undergoing a complete transition to cocoa). I’ve worked extensively with the xcode plugin architecture, so if you need any help with some of it’s quirks let me know.



I dont have one. :slight_smile: or better :frowning:

If I use the template supplied with 2.4 I have an info.plist. However if I want f.e to use the code what Apple did provide at
then nothing happens. No menu. Even with other sample code. Nothing. No beep.
I think I miss something here, a connection or so. Literally and figuraly. :rolleyes: Did try some connections but messed things up. So I did use an older Xcode plugin template, and this older one, like you wrote, has no info.plist.

How can I get the 2.4 template get to work with onLoad and Menu items, like the sample? What DID I forget, or what did Apple forget to write down in the docs?

I was afraid to insert a new info.plist because it looks like that Xcode generate one. One is inside the bundle. I did add the
and the console does complain anymore.

I hope that xcode is smart enough not to overwrite that file.

Anyway, I hope you can answer my first question about the 2.4 version.

Again thanks

Even though the default script that comes with the plugin has a “plugin loaded” handler already in it, the connection is NOT made by default in IB. In IB, click on the “File’s Owner”, and in the inspector “Applescript” pane make sure to check the “plugin loaded” handler and connect it to the script that you’ve pasted the code from apple’s site into.

Actually, even the old xcode version plugin templates have an info.plist, they just don’t have the “XCPluginHasUI” entry by default.

If there’s already one there, don’t add a new one. Just add an entry. Xcode should NEVER overwrite changes you’ve made, to the info.plist, so don’t worry about that. If it’s not complaining then you’ve found gold. As I said, you may want/have to make the value “YES” in order for ui elements, perhaps even the menu items, to be created.


Thats the problem, in de under part there is not script available to connect with. Also when I click new I can create a new scpt or applescript text file but it doesn’t show up in the lowerpart. [added] I don’t see targets as well[/added]When I use the older template it shows up there and that works.

I did use v1.3, and in there there is a infoPlist.strings and after compile then there becomes a info.plist inside the bundle. Also in the template, no Info.plist.

I meant to write ‘doesn’t complain’. sorry about that.

1.3 gold, but no 2.4 gold Hmmm pitty, I did try ‘YES’, “NO” even 'PLEASE" but no Gold! about 2.4. I should keep digging.

In the 2.4 nib template ( a copy of course ) I dont see the «PROJECTNAMEASIDENTIFIER»Plugin.applescript conection in the lower part. Where is it? I see it in 1.3



I took the nib from 1.3 and the other items from 2.4. This works!
If you say that you 2.4 version works then I guess that my NIB is damaged.