Question

Hey, So i am working on a Core Data app and I have an NSTableView linked with the Core Data. The table has three columns. Name, Position, Salary. I also set up a double click action. now what I need is that when I double click on a row i get the three values of that row. I can do the following:

NSArray* myArray = [arrayController selectedObjects];
NSLog(@"%@", [myArray objectAtIndex:0]);

But the output I get there is:

 (entity: Employees; id: 0x617890  ; data: {
    Name = "Joe";
    Position = "Manager";
    Salary = "1";

Is there a way to get those seperated?

Thanks

Was it helpful?

Solution

I figured it out.

NSArray* selectedObjects = [arrayController selectedObjects];
NSLog(@"%@", [selectedObjects objectAtIndex:0]);

NSEntityDescription *entity = [selectedObjects objectAtIndex:0];
NSLog(@"%@", [entity valueForKey:@"Name"]);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top