request for member 'font' in something not a structure or unioun

Discussion in 'iOS Programming' started by Ankit.vaghela, Dec 20, 2010.

  1. Ankit.vaghela, Dec 20, 2010
    Last edited by a moderator: Dec 21, 2010

    macrumors newbie

    Joined:
    Dec 20, 2010
    #1
    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!!
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    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.
     

Share This Page