Re: re-making connections with a different controller
Re: re-making connections with a different controller
- Subject: Re: re-making connections with a different controller
- From: WT <email@hidden>
- Date: Wed, 10 Jun 2009 02:12:05 +0200
Hi Stephen,
one approach that I have successfully employed several times when
having to do a substantial amount of dreadful and error-prone
mechanical work on xib files, of the kind you're talking about, is to
use a text-editor and do a search and replace on the contents of the
xib file. This works because xib files are xml files.
So, in your particular case, I'd set up ONE tab then copy all of its
contents to all other 9 tabs, then save and close the xib file. Then
I'd open the same xib file in a text editor (my favorite is BBEdit)
and do a search/replace for the controller name. You can even do a
grep search and replace so you won't have to do the same operation 9
times, but only once.
If you haven't done this before, though, I strongly recommend that you
keep a backup of your xib file prior to messing with it inside the
text editor, because it's easy to muck things up and end up with a
corrupted xib file.
Good luck.
Wagner
On Jun 10, 2009, at 1:15 AM, Stephen Blinkhorn wrote:
Hi all,
Imagine I have an NSTabView with 10 tabs that all contain the same
collection of controls. The only difference is that each control's
action/outlet is connected to a different controller object (of the
same class type). Is it possible to select a whole tab of controls,
copy them to the next tab and somehow change all the connections to
and from Controller1 so that they now connect to Controller2,3,4,5,6
etc without having to do 300 CTRL drags.
Perhaps this illustrates an underlying fundamental problem with the
structure of my app but I don't want to know about that right
now :) Well, ok, maybe I do...
Thanks,
Stephen
_______________________________________________
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