Re: Search & replace in nib files?
Re: Search & replace in nib files?
- Subject: Re: Search & replace in nib files?
- From: Glen Low <email@hidden>
- Date: Tue, 16 Mar 2004 09:05:54 +0800
On 16/03/2004, at 2:41 AM, email@hidden wrote:
From: Fred Glover <email@hidden>
Subject: Re: Search & replace in nib files?
Date: Mon, 15 Mar 2004 10:13:15 -0800
To: email@hidden
The simple way is with BBEdit.
If you drag the .nib file to BBEdit it will "open" the package and give
you a list of the contained files. Then you can edit each of them
easily.
Unfortunately, BBEdit's otherwise excellent search utility can't seem
to search each of the contained files from the package level. You'll
have to search/replace in each file individually.
Disclaimer: I haven't tried actually building and running a project
modified this way so caveat emptor. back thyself up.
Does BBEdit work with binary files, like the keyed archive file
"keyedobjects.nib" within a NIB package? I tried the UNIX sed command
to do a find and replace but that really screwed up the binary file,
presumably because it had encoded lengths and such which weren't then
updated.
In case anyone's interested, here's what I finally did, and it seems to
work:
1. nibtool -r -C SomeObject PGSomeObject MyNib.nib -- for each
SomeObject you want to change to PGSomeObject. Note you have to do a
nibtool call for each object.
2. sed -e "s/SomeObject/PGSomeObject/g" MyNib.nib/classes.nib >
MyNib.nib/classes2.nib -- since nibtool had left the inner classes.nib
file unchanged.
3. Delete classes.nib and rename classes2.nib to classes.nib.
4. Open MyNib.nib in IB. Most of the classes will have been changed
except for a couple stragglers like table column objects etc. IB should
flag these with a warning badge, so it's fairly easy to spot them.
5. Save the nib.
Cheers, Glen Low
---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.