CFRunLoopRef 源碼
https://opensource.apple.com/tarballs/CF/MachOView 源碼
https://github.com/gdbinit/MachOView-
使用 clang 將
OC
轉(zhuǎn)化成C++
代碼xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc OC源文件 -o 輸出的CPP文件
xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc main.m -o main.cpp
如果需要鏈接其他框架,使用
-framework
參數(shù)。比如-framework UIKit
-
在使用clang轉(zhuǎn)換OC為C++代碼時,可能會遇到以下問題
cannot create __weak reference in file using manual reference
解決方案:支持ARC、指定運行時系統(tǒng)版本,如:
xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc -fobjc-arc -fobjc-runtime=ios-8.0.0 main.m
-
Shell 腳本執(zhí)行
- 先賦予腳本文件執(zhí)行權(quán)限,再直接運行
chmod 755 ./run-sonar.sh
./run-sonar.sh
- 通過 Bash 調(diào)用腳本文件
bash ./run-sonar.sh
- 先賦予腳本文件執(zhí)行權(quán)限,再直接運行
-
Fix warning
-
The iOS Simulator deployment target is set to 5.0, but the range of supported deployment target versions for this platform is 8.0 to 12.3. (in target 'xxx')
Fixed:在Podfile
最下方添加如下代碼,再執(zhí)行pod update/install
:
-
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
end
版本號與你的 platform :ios, '9.0' 一致
-
Oh My Zsh
-
升級:
omz update
upgrade_oh_my_zsh -
卸載:
uninstall_oh_my_zsh
-
ATS 問題
iOS 9 默認非HTTPS
網(wǎng)絡(luò)靜止訪問,需要在info.plist
文件添加NSAllowsArbitraryLoads
字段并設(shè)置成YES
。但是iOS 10
從2017年1月1日
起 Apple 不允許通過這個方法跳過ATS
,必須強制使用HTTPS
,若不這樣做,上傳App Store
可能被拒。但是還可以通過設(shè)置
NSExceptionDomains
字段來針對特定的域名開放HTTP
通過審核。Push 的 pem 文件生成
終端執(zhí)行以下命令,生成ck.pem
文件
openssl pkcs12 -in ck.p12 -out ck.pem -nodes
測試 pem 證書文件是否有效
a. 測試開發(fā)證書
:
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert apns_dev.pem
b. 測試生產(chǎn)證書
:
openssl s_client -connect gateway.push.apple.com:2195 -cert apns_inhouse.pem
Fix
iOS 12.1
二級頁面pop
的時候tabbar
跳動的 Bug
[[UITabBar appearance] setTranslucent:NO];
echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.zshrc