Re: Cocoa n00b frustrations
Re: Cocoa n00b frustrations
- Subject: Re: Cocoa n00b frustrations
- From: Andreas Mayer <email@hidden>
- Date: Thu, 5 Jun 2008 17:23:56 +0200
Am 05.06.2008 um 15:32 Uhr schrieb Charles Jenkins:
I had a Nib file that went bad.
Never had that problem, so I can't help much. But, as you found out,
the best way to fix it is probably to create a completely new nib.
You create an object (.h, .m, and object instance in IB) that a
control (like a table view) will use as a delegate.
You typically do not instantiate delegate objects in IB.
Usually you will create your delegates in code and connect them to
your view objects through outlets.
If checking and rechecking the connection and the method's
declaration and implementation doesn't help, how do you solve the
problem?
You need to make sure that you are *really* working/testing with the
object instance that you did connect to in IB.
Objective-C's delegation paradigm is like magic when it works, but
mysterious and frustrating when there is a problem.
There's nothing magic or mysterious in regard to delegates. A delegate
is just an object that another object will send messages to.
Besides a malformed method signature and a missing IB connection,
what else could be wrong?
You got the wrong object instance? It is a rather common mistake by
new developers to instantiate an object in IB *and* create an instance
in code. You end up with two distinct objects and are likely to
confuse the two - or rather you might not even realise that there is
more than one object.
Andreas
_______________________________________________
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