I have an xib file containing a custom cell. I am trying to access the height of an object created in customCell.m.
Here is my code:
customCell.m
- (void)awakeFromNib
{
self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 50, 200)];
[self.label setText:@"This is a label"];
[self.myView addSubview:self.label];
NSLog(@"%f", self.label.frame.size.height);
}
mainViewController.m
- (void)viewDidLoad {
[super viewDidLoad];
customCell *cellVC = [[cutsomCell alloc] init];
NSLog(@"%f, %f", cellVC.label.frame.size.height);
}
user4487951
source
share