1
我用NSImageCell,一些NSTextFieldCells和NSPopUpButtonCell创建了NSCell的定制子类。NSPopUpButtonCell在定制单元格内不点击时弹出
我初始化使用弹出电池:
myPopUpCell = [[NSPopUpButtonCell alloc] init];
[myPopUpCell setBordered:NO];
[myPopUpCell setAutoenablesItems:NO];
[myPopUpCell addItemsWithTitles:[NSArray arrayWithObjects:@"Item1", @"Item2", @"Item3"]];
而且在drawInteriorWithFrame:inView:
绘制的一切似乎只是在弹出的细胞,当点击运行时我的应用程序的工作的伟大,单元格不会弹出。任何有关可能出错的建议?
可能只是一个剪切和粘贴错误,但arrayWithObjects列表需要终止。例如[myPopUpCell addItemsWithTitles:[NSArray arrayWithObjects:@“Item1”,@“Item2”,@“Item3”,nil]]; – Abizern 2009-05-29 22:43:20