Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
C#
for (int i = 0; i < [getArray count]; i++)
    {
        NSString *str=[[getArray objectAtIndex:i]valueForKey:@"rating"];
        UIImageView *img=[[UIImageView alloc]initWithFrame:CGRectMake(n*17, 100, 15, 30)];
        img.image=[UIImage imageNamed:str];
        [self.view addSubview:img];

        /* create label
      UILabel *label =[[UILabel alloc]initWithFrame:CGRectMake(n*17, 100, 15,30)];
         label.text = [[getArray objectAtIndex:i]valueForKey:@"rating"];
         label.font = [UIFont fontWithName:@"Times New Roman" size:30];
    
         label.textColor = [UIColor darkTextColor];
         label.textAlignment = NSTextAlignmentCenter;
         [self.view addSubview:label];
         n++; */
        n++;
    }
Posted
Updated 25-Nov-14 20:39pm
v2
Comments
KarstenK 9-Dec-14 8:45am    
why havent you NSLog the output. Maybe you have a typo...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900