Re: What can be in an IB Plugin?
Re: What can be in an IB Plugin?
- Subject: Re: What can be in an IB Plugin?
- From: Ricky Sharp <email@hidden>
- Date: Thu, 22 Nov 2007 09:44:45 -0600
On Nov 22, 2007, at 8:33 AM, Rick Hoge wrote:
The final thing I am getting my head around is the fact that any
configuration changes to the UI items in the Library nib file done
in IB won't propagate to other nibs that have already used those
items. Functionality provided by the framework will be updated, of
course, but if I change the text on an NSButton I'll have to
manually update any nib files that have used that button in the
past. I would like to make sure that I am understanding this
correctly, and not missing any efficient ways to handle this kind of
situation.
If I read this correctly...
You start by having a Plug-in with corresponding framework with a
custom view. Say that view has a default background color of green.
You drag this into a nib and save. At this point, your view's
encodeWithCoder: is called and an NSColor of 'green' is saved.
Say you then modify the custom view to be yellow by default. When
dragging them into nibs, they will show up with yellow. But, any
previous nibs with that view will still be green. This is because
when you open up the previously saved nibs, initWithCoder: is called
for each of the instances (not initWithFrame: or whatever designated
init you have set up). So, the color will be set to whatever was
archived at the time.
If that's what you meant, then yes, this is normal behavior.
Basically, any attributes that are encoded will not be automatically
updated. You'll need to inspect each object and change accordingly.
This hit me as well a few years back, and it's just tedious work.
Initially, all my controls had a 'shadow' attribute where I defaulted
the color to 50% black. But, at a later point, I needed to change
that to 33%. I needed to inspect every object in each nib to make the
change. I suppose in theory there's some method to automate this with
a tool? IB 3.x definitely makes this job easier as you can at least
select similar multiple objects and edit common attributes all at once.
And, what you say about changed functionality is also true. Such
changes will be picked up by every one of your custom objects since
there will only be one implementation of your functionality at any
given time.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden