Getting the selected object from a popup button
Getting the selected object from a popup button
- Subject: Getting the selected object from a popup button
- From: Joakim Danielson <email@hidden>
- Date: Tue, 4 May 2004 18:00:03 +0200
Hello
I have three popup buttons, two text fields and a button to create a
search criteria against my database. Each popup is using
NSArrayController which is bound to an array in my controller class.
The problem is that I do not understand how to get the selected object
from the popup in my doSearch method.
I've tried the following:
anObject = [transactionTypeList
objectInObjectArrayAtIndex:[transactionTypeArrayController
selectionIndex]];
but selectionIndex always return 0 or 1, depending on if I'm using a
null placeholder or not.
I also tried
anObject = [[transactionTypeArrayController selectedObjects]
objectAtIndex:0];
but it always returns the first object and not the selected object.
I must be doing something terrible wrong but right now I'm out of ideas.
Joakim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.