-------------------------------------------------------------------------*/
#ifdef __OBJC__
#import <objc/objc-class.h>
+#import <Foundation/NSObjcRuntime.h>
class wxPoseAsInitializer
{
public:
- wxPoseAsInitializer(Class poser)
- : m_poser(poser)
- , m_next(sm_first)
+ wxPoseAsInitializer()
+ : m_next(sm_first)
{
sm_first = this;
}
- ~wxPoseAsInitializer()
+ virtual ~wxPoseAsInitializer()
{
- class_poseAs(m_poser,m_poser->super_class);
sm_first = m_next;
}
static void InitializePosers()
}
};
protected:
- Class m_poser;
wxPoseAsInitializer *m_next;
static wxPoseAsInitializer *sm_first;
};
};
#define WX_IMPLEMENT_POSER(poser) \
-wxDummyForPoseAsInitializer wxDummyPoseAsInitializerFor##poser(new wxPoseAsInitializer([poser class]))
+class wxPoseAsInitializerFor##poser: public wxPoseAsInitializer \
+{ \
+protected: \
+ virtual ~wxPoseAsInitializerFor##poser() \
+ { \
+ class_poseAs([poser class],[poser superclass]); \
+ } \
+}; \
+wxDummyForPoseAsInitializer wxDummyPoseAsInitializerFor##poser(new wxPoseAsInitializerFor##poser)
#else // __OBJC__
#warning "Objective-C++ Only!"