title: extracting variable from one method to another method in the same .m file in objective c, xcode
body: <p>Hello I would like to know how to use a variable from this method</p>
  
  <pre><code>+ (NSString *) yourCalculation:(NSString *)height:(NSString *)weight{
      double bmiVal = 0;
       if (weight &gt; 0 &amp;&amp; height &gt; 0) {
           CGFloat wInPounds = [weight floatValue];
           CGFloat hInInches = [height floatValue];
           CGFloat hInCms = hInInches *0.393700787;
      }
  }
  </code></pre>
  
  <p>in this method</p>
  
  <pre><code> +(NSString *) actualCalculation{
         float val = wInPounds/(hInCms*hInCms);
         float bmiVal = val *703;
   }
  </code></pre>
  
  <p>This is only a small segment of the code, but it gets across what I want to do with it.</p>
  
  <p>If anyone can tell me how to do this, I would appreciate it.</p>
  
  <p>Thanking You</p>