如何將資源檔案編譯成自定義框架或靜態庫(意思是編譯成 Mach-O 檔案)?感謝您的任何提示。
uj5u.com熱心網友回復:
假設“資源檔案”是指任意二進制檔案,您可以通過創建匯編檔案(例如resources.S)將它們包含到任何二進制檔案中,如下所示:
.section __RESOURCE,__file1
_symbol_file1:
.incbin "file1.zip"
.no_dead_strip _symbol_file1
.section __WHATEVER,__file2
_symbol_file2:
.incbin "file2.bin"
.no_dead_strip _symbol_file2
// etc, you get the pattern
如果您還沒有可以在其中包含此檔案的專案,那么您可以將它本身變成一個 iOS arm64 框架,如下所示:
mkdir MyResources.framework
xcrun -sdk iphoneos clang -arch arm64 -shared -o MyResources.framework/MyResources resources.S
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/405822.html
標籤:
上一篇:SwiftUI:漸變填充未顯示
