title: iOS: Converting id to int
body: <p>I have troubles converting id of an object to int (or NSINteger), so that I can use it in a loop later.</p>
  
  <p>Here is the case:</p>
  
  <pre><code>// "tasks" is a mutable array
  int taskNo = [[tasks indexOfObject:@"something"] integerValue];
  </code></pre>
  
  <p>But it results in:</p>
  
  <pre><code>Bad receiver type 'NSUInteger' (aka 'unsigned int')
  </code></pre>
  
  <p>I found a similar thread with code similar to what I have above, but unfortunately it didn't work for me. I guess I must be missing something simple.</p>
  
  <p>Thanks a lot!</p>