Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 21st, 2012  |  syntax: None  |  size: 1.11 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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]]