开发者

Using KVC operator e.g., @unionOfSets/@sum in IB's Value Binding Model Key Path

开发者 https://www.devze.com 2022-12-13 01:24 出处:网络
I am not sure if this can be done -- it looks like it should be a straightforward thing but I keep getting \"the entity Sale is not key value coding-compliant for the key \"@sum\".\"开发者_运维百科

I am not sure if this can be done -- it looks like it should be a straightforward thing but I keep getting "the entity Sale is not key value coding-compliant for the key "@sum"."

开发者_运维百科

I using "@unionsOfSets.departments.@sale.amount" for the Table column value binding. I am doing it right, or what is the right way to do this?

Using KVC operator e.g., @unionOfSets/@sum in IB's Value Binding Model Key Path


First, take an other look at the KVC Programming Guide's Set and Array Operators section. KVC's set and array operators are powerful, but it's easy to get them wrong, even after you've grokked the system. And it's nearly impossible to get them right until you do.

That said, I think you mean you used "@unionOfSets.departments.@sum.amount" since you say the error involves @sum, and @sale isn't a legal KVC operator. Assuming that's right, and that you have a model like foo->*departments->*sales.amount, you probably want something like

"@sum.departments.@sum.sales.amount"

to get the total sales for all departments.

0

精彩评论

暂无评论...
验证码 换一张
取 消