Note that there are some explanatory texts on larger screens.

plurals
  1. POIBOutletCollection and initializing Custom Class Instance
    primarykey
    data
    text
    <p>I am using the MHRotaryKnob Class and having trouble configuring it so that multiple outlets have the same default settings. It is no problem to get it working with one instance using IBOutlet, but now it is looking for the properties of the MHRotaryKnob class in NSArray.</p> <p>How exactly do I define rotaryKnob in the implementation so that the settings are relayed to all controls hooked up to IBOutletCollection? The properties in the implementation are defined in MHRotaryKnob.m but now the compiler is looking for it in NSArray. </p> <h2>ViewController.h</h2> <pre><code>#import &lt;UIKit/UIKit.h&gt; #import "MHRotaryKnob.h" @interface CBViewController : UIViewController @property (nonatomic, retain) IBOutletCollection (MHRotaryKnob) NSArray *rotaryKnob; </code></pre> <h2>ViewController.m</h2> <pre><code>#import "ViewController.h" #import "MHRotaryKnob.h" @implementation CBViewController; @synthesize rotaryKnob; - (void)viewDidLoad { [super viewDidLoad]; rotaryKnob.interactionStyle = MHRotaryKnobInteractionStyleSliderVertical; rotaryKnob.scalingFactor = 1.5f; rotaryKnob.defaultValue = rotaryKnob.value; rotaryKnob.resetsToDefault = YES; rotaryKnob.backgroundColor = [UIColor whiteColor]; rotaryKnob.backgroundImage = [UIImage imageNamed:@"knob_passive.png"]; [rotaryKnob setKnobImage:[UIImage imageNamed:@"knob_passive.png"] forState:UIControlStateNormal]; [rotaryKnob setKnobImage:[UIImage imageNamed:@"knob_highlighted.png"] forState:UIControlStateHighlighted]; [rotaryKnob setKnobImage:[UIImage imageNamed:@"Knob Disabled.png"] forState:UIControlStateDisabled]; rotaryKnob.knobImageCenter = CGPointMake(35.0f, 32.0f); [rotaryKnob addTarget:self action:@selector(rotaryKnobDidChange) forControlEvents:UIControlEventValueChanged]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload