删除正确选择的NSManagedObjects [英] Remove correctly selected NSManagedObjects
问题描述
看看这个很棒的屏幕截图,我想你可以想象我会问的...
Look at this great screenshot and I think you can imagine what I could ask...
屏幕快照http://a4.s3.p.quickshareit.com/files/screenshot_75d0fc54a05ec7eae3f410.png 玩家:
右侧的:首选项面板和
NSTableView
左侧:带NSPopUpButton
的主窗口(在NSMenu
;]下)
to the right: the preferences-panel and a
NSTableView
to the left: main-window with aNSPopUpButton
(under theNSMenu
;] )
弹出窗口中选定的对象已绑定到表视图中的其中之一.当我从表视图中删除(在选定的弹出窗口中)对象时,就会出现此丑陋的事情(在那里您可以看到). 我正在使用CoreData,并且NSArrayController已绑定到一个实体.
The selected object of the popup is binded to one of these in the tableview. This ugly thing (what you can see there) appears when I remove the (in the popup selected) object from the tableview. I'm using CoreData and the NSArrayController is binded to one Entity.
我发现2件事有趣:
NSManagedObjectContextObjectsDidChangeNotification
[NSPopUpButton synchronizeTitleAndSelectedItem];
首先,我知道何时有人从表视图中删除项目;不幸的是,第二个不适用于我的问题...
With the first I know when someone removes a item from the tableview; the second doesn't work unfortunately for my problem...
那么有什么主意如何炸开这个丑陋的东西吗? = D
So any idea how to blast away this ugly thing? =D
顺便说一句:如果您对这个漂亮的应用程序和一个本机URL缩短程序感兴趣,您应该在这里查找.
By the way: If you are interested in this nice app and a native URL shortener you should look here.
推荐答案
我知道了!
我只是取消绑定了NSPopUpButton的选定对象,然后再次将其绑定.从列表中删除所选对象时,它将执行此操作only
. ;)
I have it!
I just unbinded the selected object of the NSPopUpButton and binded it again. It performs this action only
when the selected object was removed from list. ;)
这篇关于删除正确选择的NSManagedObjects的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!