我把我的手机升级到了iOS11,不再支持system()函数。我想在按下按钮后关机,我该怎么做?Respring在posix_spawn中工作得很好。我以前的代码是:
(void)shutdownButtonPressed{
system("shutdown");
}发布于 2018-12-30 09:50:00
在the shutdown source看来,这样做的正确方法是:
#define RB_HALT 0x08
extern void* reboot3(int how);
(void)shutdownButtonPressed {
// for a real reboot, just pass 0 instead of RB_HALT
reboot3(RB_HALT);
}https://stackoverflow.com/questions/53922933
复制相似问题