I would like to know how to add a userInfo object, or any NSDictionary, to a UIAlertView?
Thank you.
It works for me if i give it a literal c string such as "key" instead of creating a static char
Instead, taking into account what Anomie says, you could instead do this:
objc_setAssociatedObject ( alert , (const void*)0x314 , notification , OBJC_ASSOCIATION_RETAIN ) ;
This works for anything which allows you to use arbitrary void* (observation, this function, etc) and requires no extra static variable tricks. Also, (const void*)0x314 is ALWAYS 0x314, no matter what the compiler does.
Also, Anomie, you just saved me a LOT of work in an app I'm working on right now. Thanks!