Guest User

Untitled

a guest
Jun 21st, 2012
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. How Can I Edit My Array's For Loop To Reflrect This?
  2. pickerArray = [[NSMutableArray alloc] initWithCapacity:700];
  3. for ( int i = 1 ; i <= 1000 ; i = i++)
  4. [pickerArray addObject:[NSString stringWithFormat:@"%i", i]]
  5.  
  6. float weight = [[pickerArray objectAtIndex:row] intValue];
  7. label.text = [NSString stringWithFormat:@"%f lb", weight];
  8.  
  9. pickerArray = [[NSMutableArray alloc] initWithCapacity:700];
  10. for ( float i = 0.0 ; i <= 1000.0 ; i = i + 2.5)
  11. {
  12. //[pickerArray addObject:[NSString stringWithFormat:@"%.1f", i]]
  13. [pickerArray addObject:[NSNumber numberWithFloat:i];
  14. }
  15.  
  16.  
  17. float weight = [[pickerArray objectAtIndex:row] floatValue];
  18. label.text = [NSString stringWithFormat:@"%.1f", weight];
  19.  
  20. for ( float f = 0; f <= 1000; f = f + 2.5 )
  21. [pickerArray adObject:[NSString stringWithFormat:@"%.1f", f]];
  22.  
  23. [pickerArray adObject:[NSString stringWithFormat:@"%.1f", 2.5*i]];
  24.  
  25. float weight = [[pickerArray objectAtIndex:row] floatValue];
  26.  
  27. pickerArray = [[NSMutableArray alloc] initWithCapacity:1001];
  28. for ( int i = 0 ; i <= 1000 ; ++i)
  29. [pickerArray addObject:[NSString stringWithFormat:@"%.1f", 2.5*i]]
Advertisement
Add Comment
Please, Sign In to add comment