I've got a fixed controller with dynamic views as its view. I want to set value for property of a certain view.
Here's code in the controller as below:
@property (nonatomic, retain) Class viewClass;
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view = _viewClass.new;
if ([_viewClass resolveInstanceMethod:@selector(lineAdded)]) {
[_viewClass setValue:@YES forKey:@"lineAdded"];
}
self.view.backgroundColor = [UIColor whiteColor];
}
In * the certain* view, I've got a property like this.
@property (nonatomic, assign) BOOL lineAdded;
It reminds me
Undeclared selector 'lineAdded'
When I run, it just skip if condition and go on.
My question is: is it impossible to set property when the class it belongs to isn't specified?
Hope somebody could help me. Thanks in advance.