|
|
NSPopUpButton addItemsWithTitles...
|
|
|
|
Fresh-Faced Recruit
Join Date: Dec 2002
Status:
Offline
|
|
I want to add items to my NSPopUpButton with an array. This is the reason why I decided
to use addItemsWithTitles. I'm not sure exactly what exactly needs to be the items in the array.
addItemWithTitle: uses an argument of NSString *. Does the array need to be an array of NSString *. My array is actually an array of a class with the following instance varialbes
NSString *categoryDescription;
NSMutableArray *categoryRoles;
I want the NSPopButton to use the categoryDescription as the titles displayed.
I tried using addItemsWithTitles:categoryArray
and got Category isEqualToString: selector not recognized..
Can I not use the said method with an array of a class of mine..
What I want to accomplish is that when the user selects the NSPopUpButton, I then display is an NSTableView the categoryRoles.
Thanks.
ron
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Yes, the array must be of NSStrings.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Nov 2002
Location: Rockville, MD
Status:
Offline
|
|
you probably could use an array of your own class, as long as your own class implemented enough of the NSString methods...
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
If you'd like the convenience of being able to pass an array of your model objects to an NSPopUpButton, take a look at our categories in the open source OmniAppKit framework. We have a couple of methods for doing just that -- your model objects just need a title method, and that's that. Quite useful in EOF apps, among other things...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|