4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RealmSwift でハマったのでリベンジしてみた。

Last updated at Posted at 2016-05-16

先日、こんな所ではまりました。
再挑戦してみました!

参考にしたサイト

Realm公式サイト を参考にさせていただいております。

テストプロジェクトを作成

testRealm1 ってプロジェクトを作りました。
Master-Detail Application
20160515231632.png

※ まずは、動作チェック
20160515231804.png

ターミナルでアクセスして、CocoaPodsでインストールを試みます。

$ pod version
    1.0.0.beta.3
$ pod init 

$ vi Podfile で PodFileを修正します。
20160515232256.png

$ pod install 結果はこんな感じ。
20160515233642.png

入ったように見える。
フォルダ内部はこんな感じに変更になりました。
20160515233936.png

$ open testRealm1.xcworkspace 

取り敢えず、Realmを何も使っていない状態で、動くかどうかの動作チェックとして、ビルドしてみました。

20160515234425.png 20160515234439.png

umbrella header 'Realm.h' not found!

。。。。??? (´・ω・`)
同じ、エラー、、、。。 辛い。

解決方法

どうやら、 CocoaPods 1.0 以上が、Realm対応していない、みたいな話らしいです。
参考: realm / realm-cocoa

cocoapods の バージョンを指定して、インストールしてみる事とします。

皆、大好き、Qiitaより、調べました。 参照先

bundler を インストールします。

$ gem install bundler
$ cd ~~/testRealm1
$ bundle init

vi Gemfile で、設定を指定します。
20160516004047.png

$ bundle install --path vendor/bundle で、Gemfileに従って、インストールを行います。

$ bundle exec pod --version
   0.39.0
$ bundle exec pod install

って事で、CocoaPods のバージョンが 0.39.0 で指定されて、Realmがインストールされました。

解決して、ビルドも通りました!! よっしゃ!!

宣伝

私事で恐縮ですが、現在、岡山で月一でSwiftのもくもく会を開いております。
興味有る方は是非、いっしょにもくもくしましょう!

image
第五回岡山Swiftもくもく会 申込ページ
Twitter ハッシュタグ: #okswift

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?