title: NSInteger to NSString mis understood
body: <p>I have a question regarding <code>NSInteger</code> to <code>NSString</code>
  i keep trying but with no luck.
  however for some strange reason one of my <code>NSInteger</code> does but i dont know why
  i have this method:</p>
  
  <pre><code>//Lets say loc_id = 869
  -(void)addResource:(NSInteger)loc_id
  {
     //[loc.chosenLocations addObject:[NSString stringWithFormat@"%@",loc_id]];
     NSLog([NSString stringWithFormat:@"addResource: loc_id:%@",loc_id]);
  }
  </code></pre>
  
  <p>Results BAD</p>
  
  <blockquote>
    <p>Because its giving me: addResource: loc_id:20987787696 in the debugger of xcode</p>
  </blockquote>
  
  <p>Its ment to be <code>loc_id:860</code></p>
  
  <p>when i try this with <code>loc_id = 8</code>
  it works pretty well why is this strange behaviour
  or what did i mis understood thanks for the tips and help.
  when i use <code>%@</code> in string format it works for <code>loc_id = 8</code> but when i try to use
  <code>%d</code> wich is normal useage it wil also result in <code>loc_id:20987787696</code>
  how come ?</p>
  
  <p>Useage of method:</p>
  
  <pre><code>-(IBAction)switchChanged:(id)sender {
    UISwitch *switchControl = sender;
    [loc addResource:switchControl.tag] 
   }
  
   -(void)addSwitch:(NSInteger)aid
   {
      UISwitch *sw = [[UISwitch alloc]initWithFrame:CGRectMake(x,y,w,h)]];
      sw.tag = aid;
      [sw addTarget:self action:@selector(switchChanged:) forControlEvents:UIControlEvenValueChanged]];
      [self.View addSubview:sw];
   }
  
   //Data is dynamic (NSObject) but for example i will exclude the dynamic data.
   for(int i = 0; i &lt; 20; i++)
   {
     NSInteger *loc_id = 868;
     [self addSwitch:loc_id];
  
   }
  </code></pre>
  
  <p>at a point i want to insert it into the NSMutableArray as commented out above but i expect a value of 869 and it giefs me 2071894069 i want the value of the int not the memory thingy</p>
  
  <p>Kind Regards,
  Stefan</p>