title: how to get NSPopUpButton selected object?
body: <p>I'm having a student class:</p>
  
  <pre><code>@interface student : NSObject{    
      NSString *name;
      NSDate *date;
  }
  </code></pre>
  
  <p>and i have a NSMutableArray for list of students, and i bound it to a NSPopUpButton like this</p>
  
  <p>content : studentArray, arrangedObjects
  content values : studentArray, arrangedObjects, name</p>
  
  <p>now I can get the student object like this:</p>
  
  <pre><code>-(IBAction)studentPopupItemSelected:(id)sender
  { 
      NSPopUpButton *btn = (NSPopUpButton*)sender;
  
      int index = [btn indexOfSelectedItem];  
      student *std = [studentArray objectAtIndex:index];
  
      NSLog(@"%@ =&gt; %@", [std name], [std date]);
  }
  </code></pre>
  
  <p>is there any way that i can get the student object directly from NSPopUpButton???? like:</p>
  
  <pre><code>NSPopUpButton *btn = (NSPopUpButton*)sender;
  student *std = (student *)[btn objectValueOfSelectedItem];
  </code></pre>