Questions tagged [key-value-coding]

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.

390 questions
0
votes
1 answer

NSUnknownKeyException for existing and non-mistyped key

I'm getting the following output: *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: the entity MyEntity is not key value coding-compliant for the key…
CGee
  • 1,650
  • 5
  • 20
  • 31
0
votes
1 answer

KVC - Filter Sets

I have a simple data model (Core Data), but here is a stripped down version of it: Account ---------------------------------------------------- NSSet transactions Transaction ---------------------------------------------------- Account…
Josh
  • 12,448
  • 10
  • 74
  • 118
0
votes
2 answers

Consuming complex JSON API responses into NSObjects using NSKeyValueCoding

The blog post SAVING JSON TO CORE DATA has some great tips for converting a JSON response into a Core Data entity. What I want to do is a little bit more specific. I'd like to take a JSON response and convert the objects using the methods in the…
rnystrom
  • 1,906
  • 2
  • 21
  • 47
0
votes
2 answers

App crashes with setValuesForKeysWithDictionary

I am using setValuesForKeysWithDictionary to populate my model object . Model object is defined as @interface Media : NSObject { NSString *userId; NSString *mediaType; } @property(nonatomic,copy) NSString *userId; @property(nonatomic,copy)…
rustylepord
  • 5,681
  • 6
  • 36
  • 49
0
votes
4 answers

Difference between dot syntax and valueForKey

Please note that update 3 is probably most relevant Im setting a NSTimeInterval property of a managed object with an nsdate object using setValue:forKey: When i attempt to get the value I get weird stuff, at runtime this NSLog(@"[managedObject…
MrJD
  • 1,879
  • 1
  • 23
  • 40
0
votes
4 answers

NSTableColumn bound to a BOOL value

i have NSTableView bound to an NSArrayController. in my model i have a BOOL field. i'm trying to bind that value to the column. it displays correctly (1 where value is YES and 0 where value is NO), but it's readonly. =( when i'm trying to edit a…
-1
votes
1 answer

How to store muliple value rows per key in java?

i have a Key ABC. This Key can have below values (number of rows in not known) A,B,C,D,E,123 A,C,V,X,S,12 A,C,D,S,A,124 so on there will multiple keys(<10,000) and every key will have multiple value row. please help how i can implement it in java…
-1
votes
2 answers

Core Data: Two Different Ways to Access Attributes, Only One Works

For the following code, of the two comment preceded lines below, only the first works. NSManagedObject * Event = [NSEntityDescription insertNewObjectForEntityForName:str inManagedObjectContext:app.managedObjectContext]; //Work but strange [Event…
-1
votes
1 answer

Is KVC possible with Swift?

I'm trying to create the equivalent of the following Objective-C in Swift. [emitterLayer setValue:@ (scale) forKeyPath:@"emitterCells.cell.emitterCells.childCell.scale"]; I have tried the following in Swift: emitterLayer.setValue (scale), forKey:…
-1
votes
1 answer

Error Key- value coding-compliant for the key view although reinstall app

This error occurs on my real device. Although I delete app & data, reinstall app, reset all setting & content on my iPhone, it still error. But it run normally on simulator. Anyone have same problems please help me!
petrhung9
  • 91
  • 7
-1
votes
2 answers

Pass NSObject (conditional data) to TableView

Firstly, sorry if the title is confusing, I'm not sure how else to word it. I'll explain my app briefly. User is presented with a Login screen (very basic, no server-side stuff), in which they can log in to three different companies (Company A,…
rosshump
  • 370
  • 1
  • 4
  • 21
-1
votes
2 answers

Python: Reading values from output of file and interpreting as dictionary as key value

I am new to dictionary and facing trouble with understanding how to interpret the output of a file as dictionary and read the key value pairs of it. Here is my script which takes the output of a file as dictionary: dicts = {} for line in sys.stdin: …
fscore
  • 2,567
  • 7
  • 40
  • 74
-1
votes
1 answer

What is this iOS error and where is it coming from?

My friend's app is getting an error and I do not know what to do about it.I researched this error and I came across so many different answers, but none of them seems to work.Any help will be appreciated. Terminating app due to uncaught exception…
Food Mood
  • 89
  • 1
  • 8
-1
votes
1 answer

KVC release objs using valueForKeyPath?

I have a lot of objects named _Obj_1, _Obj_2, etc... And I want to release all. I'm using KVC. In particular to release all, i use: MyClass *obj = nil; for ( int i=1 ; i<=14; i++ ) { obj = [self valueForKeyPath:[NSString…
elp
  • 8,021
  • 7
  • 61
  • 120
-4
votes
1 answer

Why UIButton can not use KVC to change titleLabel

let newLabel = UILbael() let button = UIButton() button.setValue(newLabel, forKeyPath: "titleLabel") crash info setValue:forUndefinedKey:]: this class is not key valuecoding-compliant for the key titleLabel how do it if use kvc ?
loseDream
  • 87
  • 1
  • 13
1 2 3
25
26