IOS-bridge-桥接

407 阅读1分钟

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    pthread_t pthread;
    NSString *name = @"ls";
    int result = pthread_create(&pthread, NULL, demo, (__bridge void *)(name));
    
}

void *demo(void *param) {
    
    NSString *name = (__bridge NSString *)(param);
    NSLog(@"hello %@ %@", name, [NSThread currentThread]);
    return NULL;
}