dictionary as contextInfo in alert sheet
dictionary as contextInfo in alert sheet
- Subject: dictionary as contextInfo in alert sheet
- From: Ron Fleckner <email@hidden>
- Date: Wed, 2 May 2007 17:37:25 +1000
Hi,
I want to pass a dictionary as the context info in an alert sheet.
I'm using NSBeginAlertSheet(). If I add a button to the sheet and
pass that button as the contextInfo, I can access the button's
(switch button) value OK in the sheet's didEnd method. But for some
reason that I don't know, passing a dictionary doesn't work. My goal
is to pass the button as well as an int (wrapped as an NSNumber of
course).
I've tried putting only the int (as NSNumber) into the dictionary,
but even that didn't work. Either I get a crash, where the last
thing I recognise in the backtrace is my didEnd method, followed by a
few private methods of the framework, I suppose, or I get this in
Xcode's runlog: -[NSCFSet getObjects:andKeys:]: selector not
recognized [self = 0x3d2270]
So in the didEnd method I do this:
NSDictionary *aDict = contextInfo;
which doesn't work.
If I pass only the button, this works:
NSButton *aButton = contextInfo;
int result = [aButton state];
Can anyone recognise what's wrong?
Thanks,
Ron
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden