【发布时间】:2018-07-22 20:16:00
【问题描述】:
正在将我的项目转换为 ARC,但由于以下错误“没有用于调用 pthread_create 的匹配函数”而无法转换。这是它所在的代码,专门发生在以pthread create 开头的行上。我怎样才能解决这个问题?它还在错误下方的侧栏中显示Candidate function not viable: no known conversion from 'NSString *' to 'void * _Nullable' for 4th argument。
我已经切断了其余的功能,但如果需要可以提供更多细节。
void World::loadWorld(std::string name)
{
if(doneLoading==0)
{
doneLoading=1;
Resources::getResources->stopMenuTune();
if(LOW_MEM_DEVICE)
{
menu->deactivate();
Resources::getResources->unloadMenuTextures();
terrain->allocateMemory();
terrain->loadTerrain(name,TRUE);
doneLoading=2;
hud->fade_out=1;
}
else
{
terrain->allocateMemory();
pthread_t foo;
pthread_create(&foo,NULL,loadWorldThread, nsstring(name));
}
}
【问题讨论】:
标签: objective-c memory-management automatic-ref-counting