I have some code that must remain as c++, but I need to store objective-c objects in these c++ classes. The objects will not be referenced anywhere else while they are stored h
I had some success using bridge casting when converting some old code to Xcode 4.3. It wouldn't let me bridge directly but I was able to bridge via a void *. I only did this to get some old code working so I can't guarantee it works perfectly.
struct {
__unsafe_unretained UIView *view;
} blah;
...
blah = malloc(sizeof(blah));
...
// Cast the pointer with +1 to retain count
blah->view = (__bridge UIView *) (__bridge_retained void *) myView;
...
// blah->view can be used as normal
...
// Transfer ownership back to ARC for releasing
myView = (__bridge_transfer UIView *)(__bridge void *)blah->view;