Key Value Coding is a mechanism for accessing an object’s properties indirectly, using strings to identify properties, rather than through invocation of an accessor method or accessing them directly through instance variables.
Questions tagged [key-value-coding]
390 questions
0
votes
1 answer
Key Value Coding clarification
From Apple's documentation I came across the following:
Setting values using key paths is not the same as setting them using
Objective-C properties. You cannot use property notation to set
transform values. You must use the setValue:forKeyPath:…

Unheilig
- 16,196
- 193
- 68
- 98
0
votes
2 answers
Trouble printing hashtable values in Ruby
I have made a hash table of English Words and their values from a text file by parsing the first word from each line as the word to be defined and all words but the but the first as the definition, using this code:
words =…

Rory A Campbell
- 131
- 2
- 9
0
votes
1 answer
Modifying Parent Attribute Value from Child in CoreData
I have following parent child relationship between two entites
In my scenario i have to update a parent attribute when some change occurs to child attribute.
+ (void)updateTaskStatus:(Task *)task
withTaskStatus:(NSNumber *)taskStatus
…

Umair
- 400
- 5
- 19
0
votes
1 answer
Get correct type value from json dictionary
is there a way in objectivec to get exact value type from a json dictionary?
For example, consider this json:
{
"ret": 0,
"state": "Italy",
"lat": 45.46347,
"lon": 9.19404
}
I want to get INT value for "ret", NSString value for…

elp
- 8,021
- 7
- 61
- 120
0
votes
1 answer
Core Data: sum/avg of attribute values only if > 0 or !=@""
I have an entity attribute in which are stored both numbers and empty field.
I need the sum and the average values of this attributes values but doing @"@sum.attributeName" or @"@avg.attributeName" I get
Terminating app due to uncaught exception…

Alain
- 105
- 7
0
votes
1 answer
NSString containing just @ ist not Key Value Compliant
Why is a NSString @"@" not Key Value Compliant?
Are there other strings that aren't compliant as well?
You can try that it is failing with this code for example:
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
[dict setObject:@"Some…

lukaswelte
- 2,951
- 1
- 23
- 45
0
votes
1 answer
Using KVC in NSSortDescriptor
I need to sort a bunch of objects based on an integer that is stored in an NSString.
I know this is one solution and it works:
NSSortDescriptor *mySortDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"from" ascending: YES comparator:^(id obj1,…

koen
- 5,383
- 7
- 50
- 89
0
votes
1 answer
Why doesn't my simple Cocoa binding work?
Cocoa bindings, KVC, and KVO are starting to make my head hurt. All I want to do is have an NSTextField's value bound to the value of a property of my view controller. Could someone tell me where I'm going wrong? Any help would be greatly…

Ben Stock
- 1,986
- 1
- 22
- 30
0
votes
1 answer
KVC select by criteria
I have a array of objects that selected from core data. I need select from this set subset of object that correspond to condition.
How to do it?

Sergey Zenchenko
- 854
- 1
- 12
- 31
0
votes
3 answers
How do you convert an array of {"name":"myName","value":"myValue"} objects into an object of "myName":"myValue" pairs in JavaScript?
I'm new to JavaScript. I'm sure this would be easy for the experienced person.
The SimpleDB getAttributes function of Amazon AWS SDK for Node.JS returns an array of data like this:
my_JSON_object =…

CommaToast
- 11,370
- 7
- 54
- 69
0
votes
2 answers
.NET container for two-way conversion data?
I have conversion tables I need to contain in memory for fast access. Until now I used a simple Hashtable were the Key was the internal code, and the Value was an object holding the external code and other meta-data.
Now we need to have a reverse…

synhershko
- 4,472
- 1
- 30
- 37
0
votes
2 answers
NSMutableArray key value coding error
Looking for help diagnosing the following error:
* Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<__NSCFBoolean 0x39d40da8> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key…

Tony
- 373
- 5
- 18
0
votes
2 answers
error on Key Value coding when using prepareForSegue
I am using the following to create a reference to a view controller in my code like this:
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if([segue.identifier isEqualToString:@"detailSegue"]){
NSIndexPath…

timpone
- 19,235
- 36
- 121
- 211
0
votes
1 answer
Collection Object operator for @firstObject Key-value coding KVC
I'm often required to retrieve the 1st object belonging to a Set. (Using that object as a representative of that set.)
I envision a Collection Object operator, akin to the
@unionOfObjects
BUT clearly
@firstObject
Is it possible to create such a…

Gabe Rainbow
- 3,658
- 4
- 32
- 42
0
votes
1 answer
NSFetchedResultsController create sections where date is nil
I am using an NSFetchedResultsController and I would like to create two sections in my table based on a date field in my entity. I don't want to section based on the individual dates, but I'd like to have one section where that date field is nil and…

Kenny Wyland
- 20,844
- 26
- 117
- 229