Subject: Re: Editing nib files in XCode 4 and other stuff




On Apr 30, 2011, at 10:33 AM, John Love wrote:

> I've just converted my long-standing XCode 3 project to XCode 4. I was very
> fortunate in that the only change I had to make was because the call to
> -setDelegate was changed from:
>
> - (void )setDelegate:(id)delegate
> to:
> - (void )setDelegate:(id < NSToolbarDelegate >)delegate
> - (void )setDelegate:(id < RunPortDelegate >)delegate
>
> for one class's ToolbarCategory and for my RunPortCategory for another Class.
>
> (1) For what reason did they make that change to -setDelegate .. just plain
> ole (id) worked ??

Because starting in Snow Leopard, Apple switched from using informal protocols
to formal & mostly optional protocols. The reason for the change is because
informal protocols allow everything to be optional, and while most of them were
100% optional, a few (like NSTableView data sources) had mandatory methods.
Until recently, this couldn't be done with a formal protocol, because formal
protocols used to require classes to implement all methods. Now it can, so they
switched everything over to the new system.

> (2) Based on what I've read (and shown) SO FAR is that XCode 3 generated
> nib's are not editable in XCode 4 and that the only way to get around this is:
> a. edit them in XCode 3 and do everything else in XCode 4 .. thank
> heavens I was smart enough to keep XCode 3 around
> b. re-generate them in XCode 4, basically starting over in XCode 4's
> integrated environment. I don't know how to do that yet .. have downloaded
> various PDFs, so I've got a lot of reading to do .. something about creating
> a file first via the File Menu .. I'll get there eventually

Si...

nce Cheetah shipped, the nib has gone through four evolutions:
1. Non-keyed classes/info/objects
2. Keyed classes/info/objects
3. Designable/objects
4. Xib

Xcode 4 cannot work with first generation nibs. If you have any, then you need
to open them in an older version of IB and upgrade them to at least the keyed
variety first.

Xcode 4 _can_ work with second generation nibs, but due to a regression in
Xcode 4, it can't commit them to SCM correctly. You can work around this by
using the command line, or a third-party SCM client, to make the commit. I've
filed a bug about this, and if this affects you, then you should as well.

Also, Xcode 4 cannot work with nibs that used IB palettes or plugins. You'll
need to open them up, change the custom controls to custom views, and then set
them up manually in an -awakeFromNib method.

Nick Zitzmann
<http://www.chronosnet.com/>



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx)

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:
http://lists.apple.com/mailman/options/cocoa-dev/maillists%40codeha.us

This email sent to maillists@xxxxxxxxx



Privacy