gpt4 book ai didi

iphone - 检测 performSelectorInBackground 结束 :withObject:

转载 作者:可可西里 更新时间:2023-11-01 05:02:08 26 4
gpt4 key购买 nike

我的 iOS 应用程序中有一个异步服务器请求:

[self performSelectorInBackground:@selector(doSomething) withObject:nil];

如何检测此操作的结束?

最佳答案

在 doSomething 方法的末尾调用?!

- (void)doSomething {
// Thread starts here

// Do something

// Thread ends here
[self performSelectorOnMainThread:@selector(doSomethingDone) withObject:nil waitUntilDone:NO];
}

关于iphone - 检测 performSelectorInBackground 结束 :withObject:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5406803/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com