Allocating a custom class in a vc. Then I set a bool value (either set or . notation). The value never gets to the custom class - always reports NO.
Googled and tried many different variations - none work. What else could be wrong with the code below?
CustomView.h
@interface CustomView : UIScrollView <UIScrollViewDelegate> {
BOOL myLocalProperty;
}
@property (assign) BOOL myProperty;
CustomView.m
@implementation CustomView
@synthesize myProperty =_myProperty;
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
myLocalProperty = _myProperty;
if (myLocalProperty==YES) {
NSLog(@"YES");
} else if (myLocalProperty==NO) {
NSLog(@"NO");
}
return self;
}
ViewController.m (in some method that is def. being called)
CustomView *myView = [[CustomView alloc] initWithFrame:CGRectZero];
myView.myProperty=YES;
This value of YES never gets to the property. Anything obviously wrong here?