objc[13262]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[13262]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
objc[13260]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[13260]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
objc[13261]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[13261]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
objc[13263]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[13263]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
临时解决方案在终端执行如下
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
永久解决方案
sudo echo "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> ~/.bash_profile && source ~/.bash_profile
本文详细解析了在Objective-C中遇到的+[__NSPlaceholderDate initialize]可能在调用fork()时在另一个线程中进行的问题。提供了临时和永久解决方案,包括设置环境变量OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES来避免崩溃。
810





