开发者

Getting data from selected row in NSTableView linked with Core Data

Hey, So i am working on a Core Data app and I have an开发者_JS百科 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


I figured it out.

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

NSEntityDescription *entity = [selectedObjects objectAtIndex:0];
NSLog(@"%@", [entity valueForKey:@"Name"]);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜