On 5 Jun 2008, at 11:32 pm, Charles Jenkins wrote:

Hi! Despite the fact that you have heard from me before on this list, I am still an newbie trying to struggle through writing my first Cocoa app.

I have experienced a couple of frustrations that I would like to share to see if anyone knows tools or practices that will help avoid them in the future.

NAUGHTY NIBS

I had a Nib file that went bad. Suddenly, my outlets doubled up: IB indicated that a class had two outlets named 'textField1' and 'textField2'.

When it came time to make connections, I had no way to tell the real ones from the ghost ones, so I changed the outlets' names in my code files and resynchronized. From that point, IB insisted that both the old and new connections existed. Worried that this might be the source of another problem I was having, I did everything I could think of to get rid of the non-existent outlets: I deleted the .h/.m and recreated them; I deleted and recreated the NSObject instance in IB; I deleted both the .h/.m pair AND the NSObject instance and recreated it all using a different class name (MyController instead of WindowController); and finally closed down IB and Xcode and edited the XIB file with TextWrangler to delete the non-existent outlet names.

Nothing worked--the new NSObject instance always magically retained the memory of textField1 and textField2--until I gave up on the Nib file by renaming my project directory and creating a new project so that I would start with a fresh Nib file. Then I moved my .h/.m files over and connected them with no problem to the new Nib.

Is there any kind of Nib repair utility that will clean up a Nib file to remove outlets, actions, and classes that do not connect up to anything in code? Having such an important file just suddenly "go bad" and have to be recreated from scratch is a real bummer.


I have seen this happen as well. Not sure, but it might be an IB 3 bug, as I never saw it until IB3.

You *can* remove the bogus references without starting over. If I recall correctly, you can see them in the list of available outlets in the 'Connections' tab and hit the 'X' button to delete each one.


hth,

G.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to