第15月第22天 libz.dylib

时间:2023-03-08 22:33:21

1.

  1. 3.在弹出的对话框中输入"cmd"+"shift"+"g"

  2. 4

    4.输入/usr/lib

https://jingyan.baidu.com/article/624e745959a39934e8ba5abb.html

2.thread

#define RunInSeparateThread(...)                                               \

({                                                                         \

__block __typeof__(__VA_ARGS__) result;                                \

[ACDFTPManagerThread runInSeparateThread:^{                            \

result = (__VA_ARGS__);                                            \

}];                                                                    \

result;                                                                \

})

@implementation ACDFTPManagerThread

+ (void)runInSeparateThread:(void (^)(void))block {
ACDFTPManagerThread *thread = [[ACDFTPManagerThread alloc] init];
thread.block = block;
thread->waitCondition = [[NSCondition alloc] init]; [thread->waitCondition lock];
NSThread *t = [[NSThread alloc] initWithTarget:thread
selector:@selector(threadMain)
object:nil];
[t start];
[thread->waitCondition wait];
[thread->waitCondition unlock];
} - (void)threadMain {
@autoreleasepool {
self.block();
[waitCondition broadcast];
}
} @end

https://github.com/0xwangbo/GetEasy/blob/6770a0be76929962de14891e4b3061654494ac1a/Pods/ACDFTPManager/ACDFTPManager/Classes/ACDFTPManagerThread.m

https://github.com/search?l=Objective-C&q=main+thread+block&type=Code&utf8=%E2%9C%93