Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dictionary as contextInfo in alert sheet



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.