Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ankit.vaghela

macrumors newbie
Original poster
Dec 20, 2010
1
0
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

Code:
- (void)loadView {
	
	[super loadView];
	
	CGRect frame = CGRectMake(10, 10, 300, 300);
	label = [[UILabel alloc] initWithFrame:frame];
[COLOR="Red"]Error 1.[/COLOR]	label.textAlignment = UITextAlignmentCenter;
[COLOR="Red"]Error 2.[/COLOR]	label.font = [UIFont fontWithName:@"Arial" size:36];
[COLOR="Red"]Error 3.[/COLOR]	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!!
 
Last edited by a moderator:
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.