BINDING INTERFACEBUILDER WITH MY NSVIEW CLASS

Karen Green

Total Post:6

Points:42
Posted by  Karen Green
 843  View(s)
Ratings:
Rate this:

I have created a class with one NSString property and four NSColor properties.
I was creating an "Interface BuilderPlugin" for subclass of NSView.
but I can not figure out where to specify plugin project for bindings.
I'll also follow the Interface BuilderPlugin programming guide but not getting sufficient answer for my question, the class description file having lists of outlets and actions but not binding.

So my question is, where I specify the bindings for my class?

  1. Tarun Kumar

    Post:214

    Points:1642
    Re: Binding InterfaceBuilder with my NSView class

    Create a methods in your initializer class +(void) initialize:
    and define them as follows:

    +(void) initialize
    {
        [self bindingProperty:@"propertyName"];
    }

    above method is used to call the bindingProperty: method.
    You may also want to specify the value class as follows:

    - (Class)classForBinding:(NSString *)binding
    {
        if ([binding isEqual:@"propertyName"])
        {
            return [NSNumber class];
        }
        else
        {
            return [super classForBinding:binding];
        }
    }

      Modified On Oct-26-2015 11:54:56 PM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!