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