Re: "remote" binding problem
Re: "remote" binding problem
- Subject: Re: "remote" binding problem
- From: Graham Cox <email@hidden>
- Date: Wed, 7 Oct 2009 14:21:57 +1100
On 07/10/2009, at 2:12 PM, David Hirsch wrote:
I would strongly recommend a property accessor for it instead of
relying on accessing the ivar directly.
But I can't bind through an accessor, can I? I'm supposed to be
able to bind to the ivar, I think.
You bind to properties, not to ivars. Properties are often implemented
in terms of ivars, but they are not the same thing conceptually.
You should generally arrange that properties are accessed via
accessors. I believe that the ability to have Cocoa automatically
"find" a property that is implemented as an ivar is a convenience too
far, probably there for historic reasons. If you design classes on the
principle that this convenience doesn't exist you'll be better off.
Whether this has a bearing on your crash isn't clear however.
Is your document's -init method being called at all? Maybe quizResults
is nil or uninitialized at the time that the currentScore property is
accessed.
--Graham
_______________________________________________
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