在我的可可观察中,只有一栏有“NSTableView(10.7 lion view based tableview)”,其中的电池是“NSTableCellView”,其中有一些观点,其中之一是“NSImageView”。
我的数据模型具有分类状态变量,我使用具有约束力的可可和一台NSValue Transformer来对这一NSImage意见作出不同的分类。
问题是,图像没有自动更新。 在情况发生变化后,图像仅反映重新填上清单后的变化。
感谢任何帮助:
在我的可可观察中,只有一栏有“NSTableView(10.7 lion view based tableview)”,其中的电池是“NSTableCellView”,其中有一些观点,其中之一是“NSImageView”。
我的数据模型具有分类状态变量,我使用具有约束力的可可和一台NSValue Transformer来对这一NSImage意见作出不同的分类。
问题是,图像没有自动更新。 在情况发生变化后,图像仅反映重新填上清单后的变化。
感谢任何帮助:
最后,我解决了我自己的问题。
我补充了模型“状况”分类不动产的观察员。 当这一状况发生变化时,实际的表层单位icon(NSImageView)根据具有约束力的可可更改,但没有更新。 然后,在观察警报方法中,仅加一字。
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
Model *m = (Model*)context;
NSInteger idx = [self.modelArray indexOfObject:m];
NSTableRowView *row = [self.tableView rowViewAtRow:idx makeIfNecessary:NO];
ListCellItem *cell = [row viewAtColumn:0];
cell.icon.needsDisplay = YES;
[cell.icon.image recache];
[cell.icon display];
}
然后,一旦情况发生变化,图像就会得到更新。
Title borrowed from this question, of which this one is not a duplicate. See my answer there for what was wrong for that questioner; I m the author of that answer, and my problem is not that one. I ...
I ve got a window set up with two NSTableViews. In Core Data I have two entities set up, one of them containing members of the other, larger grouping (e.g. cars and manufacturers). I ve got entry ...
Let s take two Core Data entities, set up as follows: Entity A: Car Attributes: year model Relationships: manufacturer (<<-> Manufacturer) Entity B: Manufacturer Attributes: ...
Apple has a nice little tutorial for making a simple master-detail interface. Interface Builder will even automatically generate one for you from a Core Data entity. However, I m trying to do ...
Been starting to work with Core Data a bit, and while I ve figured out how to use it in regular Cocoa applications, it seems it works a bit differently in Cocoa Touch. How do you bind entities to ...
I ve been trying to learn Core Data, and browsing through questions on Stack Overflow lead me to a recommendation that I try the tutorial on Core Data over at Cocoa Dev Central (Link). Everything is ...
I m trying to have a table column to display the sum of child values using the IB. I m not sure if this is doable though. So I have my Core Data bind to a table and a column of "total sales amount" ...
I am one of the great unwashed masses of .NET developers keen to try their hands at Mac OS X development. At the moment I am trying to figure out the various elements of Cocoa and getting a bit stuck ...