title: How to convert from text to number integer?
body: <p>i have input only number from text field and i want to change it to integer. what code should i write in?</p>
  
  <p>just say text field say for 10 and i want to take that 10 = x, x = integer. so if i use it for mathematic process a = x + 1 and display say 11. is there any chance? i hope you understand what i mean. thank you. i think both of you will answer this simple question but i not because im beginner. im a 3d design graphic switch 180 degree become xcode programming. BTW ive tried this before but it cant.</p>
  
  <pre><code> NSInteger number = [[txtBtn text] integerValue];
  </code></pre>
  
  <p><strong>Edited :</strong></p>
  
  <p>i've got this error, local declaration of 'number' hides instance variable, pointed to number at result = (number * 2) - 1; and i put the code like this.</p>
  
  <pre><code>NSInteger number = [[txtBtn text] intValue];
  result = (number * 2) - 1; 
  </code></pre>
  
  <p>i dont know whats wrong.</p>