title: Getting the value of multiple UISlider's in a UITableView
body: <p>I have a UITableView with UISliders on each row. They all call the -(void) sliderValueChanged: (id)sender method.</p>
  
  <p>I then have a label outside the UITableView that I populate with the value of the UISlider minus the CoreData value of Incomes. The problem is how do I take away the total slider values from the total income value. This is what I have so far but the slider value which I store in the NSNumber previousNumber variable does not work properly. Any help would great.</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
      static NSString *CellIdentifier = @"Cell";
  
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) {
          cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
          UISlider *theSlider =  [[[UISlider alloc] initWithFrame:CGRectMake(55,20,220,45)] autorelease];
          theSlider.maximumValue=[self.totalIncomes floatValue];
          theSlider.minimumValue=0;       
          [theSlider addTarget:self action: @selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged];
          [cell addSubview:theSlider];
      }
  
      NSInteger section = [indexPath section];
  
              Categories  *category = (Categories *)[categoriesArray objectAtIndex:[indexPath row]];
              cell.textLabel.text = [NSString stringWithFormat:@"%@",[category name]];
              [category release];
  
  
      return cell;
  }
  
  
  -(void) sliderValueChanged: (id)sender
  {
      UISlider *control = (UISlider *) sender;
      float value = control.value;
      float total = [self.totalIncomes floatValue];
  
      if ([self.previousNumber floatValue] &lt; value) {
          total = total - (value - [self.previousNumber floatValue]);
      }
      else {
          total = total + ([self.previousNumber floatValue] - value);
      }
  
      self.totalIncomes = [NSNumber numberWithFloat: (float)total];
      NSLog(@"%.2f", [self.totalIncomes floatValue]);
      label.text = [NSString stringWithFormat:@"%.2f",[self.totalIncomes floatValue]];
      self.previousNumber = [NSNumber numberWithFloat:(float)value];
      //[self.tableView reloadData];
  }
  </code></pre>