PDA

View Full Version : core data 2-part Q: @sum && arrayController "selection"




dj.mooky
Jul 22, 2009, 10:03 PM
First off... my app is coming along well, I've redesigned the core data model, and all of the sudden a lot more things are possible(it's a poker tracking application... anyway)

I currently have it setup something like this...

Player has an NSSet of stats, each "stats" is what happened in a given hand, such as in this case winnings per hand( NSNumber *handWinnings)

I'm trying to use bindings to accomplish this, rather than an NSValueTransformer(which I have successfully done, but has buggered up my text color transformer... ironically....)

Is there a way to skip the transformer that filters through the set to get a single float return? I'm thinking along the lines of "@sum.stats.handWinnings" but that is throwing me a KVC error "not coded for key @sum" error.


Second part of this question.
Is there a way to not only get the values of a selection in a given NSTableView(that is bound to an NSArrayController) but also get the exact managed object and send that object to a value-transformer?

If this is not so possible, does anyone know of a sly trick to send two arguments, via bindings, to a transformer / method?

Specifically, the "NSset" that is attached to an Entity "hands" as a filter method to the stats for a list of given players via name?



If any further clarification needs to be done on this to simplify the questions, please let me know.


Thanks in advance, you've all been amazingly helpful so far in my endeavors..
I could not have gotten this far without this forum
-dj.Mooky