Xcode 4 reached the final version, stability has somewhat improved but no signs of support for Interface Builder plugins. I decided to keep Xcode 3 in a separate location, just to edit the xib file where I was using IB plugins, but this is impractical:
- If you use several Macs, having two Xcode versions on each one of them is quite cumbersome; nothing worse than finding out that you need Xcode 3 and you only have Xcode 4 on your laptop… Even with a fast connection, downloading the two versions takes a long time. Yes, you need both the installers: installing Xcode 3 will break Xcode 4, even if you install it in a different folder; you must install Xcode 3 first, and Xcode 4 after;
- Whenever you change the code of some files referenced by your xib, you need to open the entire project again in Xcode 3, or Interface Builder won't be aware of the changes (you won't be able to use new outlets or actions for example); this is no big deal, but it can quickly become messy. Just an example: if you add files in Xcode 4, Xcode 3 won't be aware of them.
Finally I decided to remove all dependencies from the IB plugin I was using. I was using the Shortcut Recorder framework in my application: if this is your case, removing IB plugins is a fairly simple task.
The idea is simple: instead of directly using the SRRecorderControl object directly (which is a plugin), just use the class it is derived from, so Xcode 4 will be able to open the xib.
Just follow these steps, and you won't need Xcode 3 any longer:
- Open your xib file in IB3 (this is the last time you will need it);
- Select the object using an IB plugin (SRRecorderControl in my case);
- Jot down all important information:
- Size and position;
- References (delegate, outlets, etc.);
- Name of the object's class (i.e. SRRecorderControl);
- Size and position;
- Check the parent class name (NSControl in my case);
- Delete the object;
- Add an instance of the parent class;
- Change the class name to the correct one (i.e. SRRecorderControl);
- Add all other pieces of information that you noted earlier;
- Save the file;
- You are done: you can now close IB 3 and you will be able to open the file in Xcode 4.
If your plugin is more complex and you are using advanced features this won't be sufficient, and you will have to adapt the code, but in the simple case of Shortcut Recorder this does the trick.