title: Passing float value from ViewController to some Class
body: <p>I'm new to objective-c programming and I stuck.
  I have uislider in my viewcontroller and float variable in header file of viewcontroller.
  I also have a new class which changes look of my second view, I overwritten drawRect.</p>
  
  <p>I simply take value of slider.value and save it in my float variable then I try to access float variable in my class because this variable defines width of lines which i want to draw.</p>
  
  <p>header file of my view controller</p>
  
  <pre><code>@interface ViewController : UIViewController 
  {
  float lineWidth;
  }
  
  @property float lineWidth;
  -(float)changingline;
  @end
  </code></pre>
  
  <p>viecontroller.m  //sliderForLine = UISlider</p>
  
  <pre><code>- (IBAction)valuechangedForLine:(UISlider *)sender 
  {
  
  float sliderValue = sliderForLine.value;
  lineWidth = sliderValue;
  [self changingline];
  
  }
  -(float)changingline
  {   
  NSLog(@"%f", lineWidth);
  
  return lineWidth;
  } 
  </code></pre>
  
  <p>NSLog says there is some value in lineWidth</p>
  
  <p>class which specifies how the second UIView should looks like</p>
  
  <pre><code>#import "ViewController.h"
  
  ViewController *oldView = [[ViewController alloc] init];
  CGContextSetLineWidth(ctx, oldView.lineWidth);
  NSLog(@"%f",oldView.lineWidth);
  </code></pre>
  
  <p>and here, in second class, NSLog says always 0.</p>
  
  <p>I'm confused, I don't even know now why I'm using -(void)changeling :)</p>
  
  <p>All I know is that I'm missing the main point how to pass values between classes, can somebody explain me what I'm doing wrong?</p>
  
  <p>Thanks in advance :]</p>