Re: Cocoa n00b frustrations
Re: Cocoa n00b frustrations
- Subject: Re: Cocoa n00b frustrations
- From: "Michael Ash" <email@hidden>
- Date: Fri, 6 Jun 2008 23:48:06 -0400
On Thu, Jun 5, 2008 at 9:32 AM, Charles Jenkins <email@hidden> 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.
In addition to the other responses you received, this is one of the
many good reasons why you should use version control, even for dummy
learning projects that you never plan to do anything significant with:
http://www.cocoadev.com/index.pl?VersionControl
If your project is in version control, then when you screw something
up that is beyond your ability to fix, you can just go back to the
last version that wasn't screwed up and try it again. Very handy, and
well worth the extra overhead required to work with the system.
Mike
_______________________________________________
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