A better subjuct might have been "How should I use interface objects to select 
command line arguments?" or something like that.  The current subject adds no 
value and will not help others search for information in the future.
   
  Having said that...
   
  One approach you might take (that will not scale to large applications that 
use the MVC pattern) is to store strings as the represented objects of your 
user interface elements.  Your code that composes the command line might look 
like this:
   
  commandString = [NSString stringWithFormat:@"runfoo %@ [EMAIL PROTECTED]", 
[[colorPopup selectedItem] representedObject], [[sizePopup selectedItem] 
representedObject]];
   
  Use setRepresentedObject: ahead of time like this:
   
  [[colorPopup itemAtIndex:0] setRepresentedObject:@"-color 4"];
  [[colorPopup itemAtIndex:1] setRepresentedObject:@"-color 1"];
   
  [[sizePopup itemAtIndex:0] setRepresentedObject:@"-small"];
   
  --- or ---
   
  You could give each user interface item a different action and build up your 
command line by setting the various options in response to action messages.
   
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to