- /*
- // setBackingType
- NSString*
- Class NSWindowClass = NSClassFromString
- NSWindowClass->methodLists
-
- void *iterator = 0; // Method list (category) iterator
- struct objc_method_list* mlist;
- Method currMethod;
- int j;
- while ( mlist = class_nextMethodList( NSWindowClass, &iterator ) ) {
- for ( j = 0; j < mlist->method_count; ++j ) {
- currMethod = (mlist->method_list + j);
- if (strcmp((const char *)currMethod->method_name, "setBackingStore")) {
- IMP imp = currMethod->method_imp;
- (*imp)(NSWindowInstance, currMethod->method_name, 0);
- // do stuff
- }
- }
- }
- NSWindow* window =
- */
+
+ id NSWindowClass = objc_getClass("NSWindow");
+ printf("nswindowclass is %x\n", NSWindowClass);
+ SEL selector = sel_registerName("initWithWindowRef");
+ printf("selector is %s\n", selector);
+ objc_method method = class_getClassMethod(NSWindowClass, selector);
+ printf("method is %x\n", method);
+ id windowInstance = objc_msgSend(NSWindowClass, selector, window);
+ printf("instance is %x\n", windowInstance);
+