PDA

View Full Version : request for member 'font' in something not a structure or unioun




Ankit.vaghela
Dec 21, 2010, 01:46 AM
Hi,
I am getting this error so many times n i don't understand that what to do....????

Error 1. request for member 'TextAlignment' in something not a structure or union
Error 2. request for member 'Font' in something not a structure or union
Error 3. request for member 'Text' in something not a structure or union

- (void)loadView {

[super loadView];

CGRect frame = CGRectMake(10, 10, 300, 300);
label = [[UILabel alloc] initWithFrame:frame];
Error 1. label.textAlignment = UITextAlignmentCenter;
Error 2. label.font = [UIFont fontWithName:@"Arial" size:36];
Error 3. label.text = @"10";
[self.view addSubview:label];
frame = CGRectMake(10, 370, 300, 10);
slider = [[UISlider alloc] initWithFrame:frame];
slider.minimumValue = 0.0;
slider.maximumValue = 100.0;
slider.continuous = NO;
slider.value = 10.0;
[slider addTarget:self

action:@selector(updateLabel:)
forControlEvents:UIControlEventValueChanged];
[self.view addSubview: slider];
}



Please Reply
Thanks!!



robbieduncan
Dec 21, 2010, 02:45 AM
Either you have not copy+pasted the code or copy+pasted the errors: TextAlignment is not the same as textAlignment. Same with the other errors.