title: IBoutlet collection.UIButton add target
body: <p>My knowledge of Xcode and Obj-C is almost inexistant so please be understanding if I pose a stupid/badly formulated question.</p>
  
  <p>I have added a series of buttons in the interface builder.
  Now I want to link those buttons to a function (let's say change a label's text)
  But each button should be able to change the text differently by sending a parameter of some sort.</p>
  
  <pre><code>-(IBAction)changeText:(NSString *) theString{
      myLabel.text=theString;
  }
  </code></pre>
  
  <p>When I add an action to a button I use something like this.</p>
  
  <pre><code>[but1 addTarget:self action:@selector(changeText : myString[1]) 
      forControlEvents:UIControlEventTouchUpInside];
  </code></pre>
  
  <p>for the second button: </p>
  
  <pre><code>[but2 addTarget:self action:@selector(changeText : myString[2]) 
      forControlEvents:UIControlEventTouchUpInside];
  </code></pre>
  
  <p>ans so on..</p>
  
  <p>My question is:
  If I have a large number of buttons, can I declare them in a loop and add the apropriate action to them at the same time? How do I do that?</p>