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
Why am I getting a key value coding compliance error?
At runtime my app is throwing this error:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key count1.
The…

shadowmaster13
- 63
- 2
- 10
0
votes
1 answer
Can't get my poker logic to properly check for a straight flush in NSMutableArray of "Card" objects
Been stuck on this problem for three days. Thought writing this question out would take longer than solving the problem myself, but I'm getting nowhere with this. I'll try to lay this out as concisely and logically as I can. In Objective-C,…

baptzmoffire
- 589
- 2
- 4
- 20
0
votes
1 answer
Search for Value & Key in Mac App
I have a Mac application that validates user credentials , Name & PIN. Using CoreData, how do I reference the key from a particular value? For example, in the database, John Doe has a PIN of 1234. When the user chooses their name, they enter their…

Green Developer
- 187
- 4
- 18
0
votes
1 answer
Key value coding crash - Objective-C
I'm trying to create an Objective-C class. When I use the -setValue: method, the program crashes at that line. Here is the code:
HugeNumber.h :
#import
@interface HugeNumber : NSObject{
NSString *value;
NSMutableArray…

moray95
- 937
- 2
- 9
- 12
0
votes
1 answer
Key-Value Coding and collection operators for collections which contain NSNull values
When using collection operators (e.g. @min,@max) on NSArrays using Key-Value Coding I get an exception if one of the values in the array is NSNull null.
I have to remove all NSNull null occurrences before using valueForKeyPath to make it…

AlexR
- 5,514
- 9
- 75
- 130
0
votes
2 answers
NSCollectionView implementation
I have looked at the documentation yet I still haven't successfully implemented a CollectionView. Here is what I have.
My KVO/KVC compliant NSMutableArray.
#import
#import "ProjectModel.h"
@interface KVOMutableArray :…

marcopolo
- 1,963
- 4
- 18
- 31
0
votes
1 answer
Max date value on NSManagedObject
I am rather confused about key-value-coding and core data.
The Apple docs show making this call
NSDate *latestDate = [transactions valueForKeyPath:@"@max.date"];
but when I add it to my own class, I get this exception
Exception [ …

darren
- 579
- 8
- 23
0
votes
1 answer
How should a virtual Core Data property be retained?
I have a NSManagedObject subclass with a virtual property which is expensive to calculate. The property depends on the value of one of the entity's concrete attributes. For performance reasons I only want to calculate the value of the virtual…

bluefloyd8
- 2,266
- 2
- 24
- 20
0
votes
1 answer
Out of scope in KVC generated array
I'm trying to create an array of objects from a hierarchy of other objects like this:
code 1:
childController.names = [[NSMutableArray alloc] init];
for (Person *p in list.persons) {
[childController.names addObject:p.name];
}
code…

johnl
- 557
- 2
- 5
- 7
0
votes
1 answer
Nested objectForKey calls work, but equivalent valueForKey call doesn't?
I have an NSDictionary representing a Flickr photo.
The description of the photo looks like something like this:
{
accuracy = 16;
context = 0;
dateupload = 1355106635;
description = {
"_content" = "Barclays Center…

Bill
- 3,584
- 5
- 35
- 47
0
votes
1 answer
FOSRestBundle no key-value in JSON
I've set up FOSRestBundle with my small Symfony2 website. I've created some small GET methods and when I visit the api url, I get my JSON data. Perfect.
But I'm trying to build an iphone app and I use RestKit for mapping/parsing json/... The…

Jesse
- 879
- 1
- 12
- 26
0
votes
1 answer
KVC Collection Accessor + index 0 beyond bounds for empty array error
I have a mutable array property declared and synthesized:
@property (nonatomic, strong) NSMutableArray *arrayOfTasks;
I am using KVC collection Accessors for the same property and also I have other methods which will internally call this KVC…

Raj Pawan Gumdal
- 7,390
- 10
- 60
- 92
0
votes
1 answer
ios stuck at an exception while subclassing uitableviewcell
I am trying to build a custom cell for UITableview. The approach I have taken is
Subclassed the UITableViewCell and created my own custom class which has members for UI components (Labels, images etc)
Created a nib and changed its class to my…

Murtuza Kabul
- 6,438
- 6
- 27
- 34
0
votes
2 answers
Key Value Coding keyPath @sum of product of values?
I have NSManagedObject with a 'one-to-many' relationship to a set of items. I love how I can use KVC keyPaths to easily get quantity below as a sum across all my items.
- (NSNumber *)quantity
{
return [self…

trapper
- 11,716
- 7
- 38
- 82
0
votes
1 answer
Unable to make accessoryview work on device, but OK in simulator
I have a table view with two dynamic prototype cells. The tableview is shown using performSegue which does a modal display of a new Navigation controller. It works fine on the IOS 6.0 simulator, but not on an IOS 5.1 device (I'm using the 6.0 SDK…

drew
- 2,371
- 2
- 19
- 27