++(NSString*) identifierForColumnPointer:(const wxDataViewColumn*)column
+{
+ // Starting from OS X 10.7 the column identifier must be an NSString and
+ // not just some arbitrary object, so we serialize the pointer into the
+ // string. Notice the use of NSInteger which is big enough to store a
+ // pointer in both 32 and 64 bit builds.
+ return [NSString stringWithFormat:@"%lu", reinterpret_cast<NSUInteger>(column)];
+}
+
+-(id) initWithColumnPointer:(const wxDataViewColumn*)column
+{
+ [self initWithIdentifier: [wxDVCNSTableColumn identifierForColumnPointer:column]];
+ return self;
+}
+
+-(wxDataViewColumn*) getColumnPointer
+{
+ // The case to NSString is needed for OS X < 10.7.
+ return reinterpret_cast<wxDataViewColumn*>(
+ [static_cast<NSString*>([self identifier]) integerValue]);
+}
+