1
votes

i have an XCode 4 project for mac desktop. It has a tableview in it that uses NSTableCellViews. The TableView is connected to an NSArrayController to provide it's content. This is using bindings for custom labels and the like, which has worked out rather well.

I have a custom view that i would like to put in the NSTableCellView, which will use custom drawing based on a NSNumber value from my Table Cell View binding.

Since XCode 4, you can no longer have ibplugins, which means i can no longer create custom bindings for interface builder to work with. How can I still get this value to my custom view?

1

1 Answers

3
votes

From your NSTableCellView subclass you can bind the custom view's property to a property in the -objectValue method of the cell. Like so:

[self.customView bind:@"title"
             toObject:self.objectValue
          withKeyPath:@"name"
              options:nil];

And pass the binding you want bound to the custom view to objectValue.name in interface builder.