Re: error displaying @count via bindings
Re: error displaying @count via bindings
- Subject: Re: error displaying @count via bindings
- From: Keary Suska <email@hidden>
- Date: Mon, 02 Apr 2007 12:29:07 -0600
- Thread-topic: error displaying @count via bindings
on 4/2/07 11:50 AM, email@hidden purportedly said:
> I am certain that it is 10.4 (on my Intel macbook)
>>
>> Which Mac OS X SDK are you linking against?
>>
>>
>>
>>> I have a class that has a NSMutableArray. I have established all
>> of the
>>> proper KVC accessors and setters to "ensure" automatic KVO. I bind a
>>> tableColumn's value to myArray.@count to display the total number
>> of items in
>>> each array instance. It works properly and displays the number of
>> items in
>>> myArray, however, I am getting a log alert that:
>>>
>>> [<NSCFArray 0x3c11c0> addObserver:forKeyPath:options:context:]
>> is not
>>> supported. Key path: @count
>>>
>>> What would account for this error?
Oop, I wasn't paying attention. I recall that the array and set operators
are not observable, at least not for an array. I think you have to "proxy"
through an NSArrayController, which I believe will eliminate the error.
Never had to do it myself, but that's what I have heard.
I don't think this is well documented, or obviously documented--i.e. neither
the KVC, KVO, or Bindings docs mention this, that I recall.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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