ibplugin

Binding a custom NSView: Does it demand creating an IBPlugin?

妖精的绣舞 提交于 2019-12-21 07:31:18
问题 I have created a subclass of NSView to draw an image as a pattern: @interface CePatternView : NSView { NSImage* image; id observableObjectForImage; NSString* keyPathForImage; } @end I implemented the following to expose bindings: + (void)initialize { // Expose the "image" binding to IB. [self exposeBinding:@"image"]; } - (Class)valueClassForBinding:(NSString *)binding { if([binding isEqualToString:@"image"]) return [NSImage class]; return nil; // Unknown binding } Unfortunately, the image

How do you display custom UIViews in InterfaceBuilder?

不打扰是莪最后的温柔 提交于 2019-12-17 15:39:57
问题 I seem to enjoy designing new UIViews and UIControls that implement their own -drawRect: method. This work well for me, especially when composed using UIViews in Interface Builder . But composing them in Interface Builder is annoying because they just show up as boring plain rectangles. It would be great if the views would actually render themselves as the built-in controls do. Is there any way I can structure my project so that Interface Builder will render my custom views? 回答1: In order to

How do you display custom UIViews in InterfaceBuilder?

橙三吉。 提交于 2019-11-27 19:27:50
I seem to enjoy designing new UIViews and UIControls that implement their own -drawRect: method. This work well for me, especially when composed using UIViews in Interface Builder . But composing them in Interface Builder is annoying because they just show up as boring plain rectangles. It would be great if the views would actually render themselves as the built-in controls do. Is there any way I can structure my project so that Interface Builder will render my custom views? Jason Coco In order to do this, you actually have to create a plug-in for Interface Builder that uses your custom class.