• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[Solved] Re: "remote" binding problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Solved] Re: "remote" binding problem


  • Subject: [Solved] Re: "remote" binding problem
  • From: David Hirsch <email@hidden>
  • Date: Tue, 06 Oct 2009 20:44:15 -0700

Okay, I'm an idiot. I did have accessors, but the getter returned the wrong type. (An early version of the quizResults ivar was an NSArray, and I neglected to fix the return type of the getter). Sorry for wasting your time! Hopefully somebody will read this in the archives and find their error in the future.

Note that I was thus incorrect: binding works through accessors, apparently. This was not clear from the docs I had read.

-Dave



On Oct 6, 2009, at 8:21 PM, Graham Cox wrote:


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


References: 
 >"remote" binding problem (From: David Hirsch <email@hidden>)
 >Re: "remote" binding problem (From: Graham Cox <email@hidden>)
 >Re: "remote" binding problem (From: David Hirsch <email@hidden>)
 >Re: "remote" binding problem (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: CoreData async fetch request
  • Next by Date: Re: Suggest reasons for this crash?
  • Previous by thread: Re: "remote" binding problem
  • Next by thread: Issues with NSWindowDelegate on multiple Mac OS X platforms
  • Index(es):
    • Date
    • Thread