| 1 | #import <Foundation/Foundation.h> |
| 2 | #if __has_include(<AppKit/AppKit.h>) |
| 3 | #import <AppKit/AppKit.h> |
| 4 | #define XXView NSView |
| 5 | #else |
| 6 | #import <UIKit/UIKit.h> |
| 7 | #define XXView UIView |
| 8 | #endif |
| 9 | |
| 10 | int main() { |
| 11 | XXView *view = [[XXView alloc] init]; |
| 12 | dispatch_group_t g = dispatch_group_create(); |
| 13 | dispatch_group_enter(g); |
| 14 | [NSThread detachNewThreadWithBlock:^{ |
| 15 | @autoreleasepool { |
| 16 | [view superview]; |
| 17 | } |
| 18 | dispatch_group_leave(g); |
| 19 | }]; |
| 20 | dispatch_group_wait(g, DISPATCH_TIME_FOREVER); |
| 21 | } |
| 22 | |