timthedevguy / BGHUDAppKit

* BGHUDAPPKIT is no longer under development by me, I hope that the community will keep it alive and going as I no longer have time to dedicate to the project** The missing HUD controls. Please scroll down to read the readme file for an important notice concerning the future of BGHUDAppKit. Note that there are multiple versions available, 10.5+, 10.6.7, and now 10.7. As soon as I learn how I'll make these all one code base if possible.
http://www.binarymethod.com/
312 stars 57 forks source link

xcode 4 compatibility #49

Closed sarperdag closed 8 years ago

sarperdag commented 13 years ago

Any news for xcode 4 compatibility on the horizon?

timthedevguy commented 13 years ago

The only advice so far from all the info I've gathered is: If you wish to keep using any plugins you will need to keep editing those nibs with IB3. XCode4 will compile the project fine BUT you will NOT be able to use the XCode4 editor for the nibs.

I've been doing class dumps of the private frameworks looking for anything that may be useful. It appears that the actual IB editor thats embedded in XCode4 is a plugin itself, so I am at a loss how to proceed now.

timthedevguy commented 13 years ago

If you have twitter please follow @binarymethod for updates as I go. I've gotten checkboxes to work with some tweaking....grrrr why did they have to screw things up.

tomaz commented 13 years ago

Plunged myself into upgrading all xib files to Xcode 4. Turns out latest build of Xcode 4.1 automatically offers to upgrade xibs when opening and it does pretty good job at it too (not sure for 4.0, haven't tried). Except for BGHUDTableView, where it complained: "An instance of BGHUDTableCornerView could not be decoded". To overcome this, I had to manually convert BGHUDTableView to NSTableView, upgrade to Xcode 4 and then change classes back. The whole procedure looked like this (in case someone will find it useful):

That's it - it should work now. Make sure you test all UI to make sure you've not forgotten to setup something. Note that all controls in Xcode 4 will look like standard ones, but at runtime they will be ok (Xcode basically replaces custom controls with standard ones and then changes their cell classes).

In some cases (when using BGHUDButtonCell for example) I had to change corresponding cell to NSButtonCell in IB3 and then manually change it back in Xcode 4 after importing (also required adding runtime attribute themeKey!).

You might also need to change xib development versioning to Interface Builder 3.2 as attributes are not supported with previous versions - you'll get compiler warnings otherwise, but other than that it seems to work fine anyway.

Hope this will help someone until better solution arises. Looks like Apple doesn't intend to add IBPlugins to Xcode 4 (or auto-upgrade is here just as a temporary measure), so we might be forced to convert sooner or later. Anyway, I can finally delete Xcode 3 and claim back some space on my disk...

Tom

apparentsoft commented 13 years ago

Another solution that I found was to manually edit the Xibs in a text editor, before importing to Xcode 4.1. There I replaced occurrences of BGHUDTableCornerView to NSView and occurrences of BGHUDTableHeaderCell to NSTableHeaderCell. After that the the XIBs loaded just fine.

timthedevguy commented 13 years ago

Nice, good tips. I'll be tackling a large project here shortly that will need it's Xibs upgraded to 4. Appreciate all the help.