1.状況
git cloneしてswiftのコーディングをしようとしたが、
ファイルが開かず、シミュレーションも起動しない。
Showing All Issues
/Documents/practice_swift/Pods/Target Support Files/Pods-todoapp/Pods-todoapp.debug.xcconfig: unable to open file (in target "todoapp" in project "todoapp")
2.原因
cocoapodsのインストールがなかった。
cocoapodsとは、
iOSアプリ作成のためのライブラリ管理をしてくれるもの
https://cocoapods.org/
cocoapodsのインストールをします。
$ sudo gem install cocoapods
$ sudo gem update –system
$ sudo gem install -n /usr/local/bin cocoapods
$ pod setup
git cloneしたプロジェクトファイルに移動してインストールをします。
$ pod deintegrate
$ pod install
結果は良さそう。DBの役割のRealmもインストールされている。
Downloading dependencies
Installing Realm (5.1.0)
Installing RealmSwift (5.1.0)
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 2 total pods installed.
Comments
参考になった。M1 Macで
が失敗するのでTerminal.appをRossetaモードで起動してやり直したら成功した。
ffiのインストール先は
Home Brewを使えばaarm64版のffi, つまりlibffi.aをインストールできるらしい。(未確認)
ちなみに、bundleは2種類あるMacの共有ライブラリDynamic Linking, Dynamic Loadingのうちの後者だ。fileコマンドの出力がそう語っている。拡張子は何でもよく、soでもOK.
[C言語] 共有ライブラリと静的ライブラリを整理する - Qiita
前者と後者の決定的な違いは何かと、気になるところだが、
.soや.dylibや.aファイル、共有ライブラリなどについて調べてみた - kanonji’s diary
これを読んでもよく分からん。しかし、Linkingはライブラリから関数だけを取り出して実行プログラムに取り付ける。たとえば、printfを使う実行プログラムはlibstd.bundleから該当箇所だけ動的にリンクする。
Loadingはもっと大きな単位でつまり、サブプログラム単位で実行時に呼び出される。これが大きな違いの様だ。pluginの動作がこれに該当する。e.g. Apache Web ServerがSSLモジュールを読み込む。
pluginは動作が終わればunloadされるが、Linkingされたprintfはunloadされることはない。
Dynamic Linking vs. Dynamic Loading | Baeldung on Computer Science
Let's comment your feelings that are more than good