so I'm writing Obj-C for iOS, and something "strange" is happening..
I have an MVC, with a UITableView (private):
@interface MVC ()
@property (strong, nonatomic) IBOutlet UITableView *tableView;
@property (strong, nonatomic) CellVC *cell1;
@property (strong, nonatomic) CellVC *cell2;
@end
I load the table view up with a few custom cells. My custom cell class is actually a UIViewController... so I instantiate a few, and set cell.contentView to the corresponding CellVC.view inside the tableView:cellForRowAtIndexPath: method. My custom cell class:
@interface CellVC : UIViewController
@property (strong, nonatomic) IBOutlet UIKnob *knob1;
@property (strong, nonatomic) IBOutlet UIKnob *knob2;
@property (strong, nonatomic) IBOutlet UIKnob *knob3;
@property (strong, nonatomic) IBOutlet UIKnob *knob4;
@end
In case you're wondering, I've written a subclass of UIControl named UIKnob...
In CellVC's viewDidAppear: method, I've set a breakpoint to check the values of every knob. Each knob is non-nil, so I am happy... they have all been created.
My goal is to set MVC as the delegate of each knob. (4 knobs for each cell) If I set a breakpoint anywhere in MVC, the value of each knob is nil??...
cell1.knob1.delegate = self;
will not work because the knobs only exist inside CellVC.m ...
Any ideas??