WatchKit Extension not working under CocoaPods

后端 未结 1 548
Happy的楠姐
Happy的楠姐 2021-01-27 08:28

Using iOS-8.3, Xcode-6.3.1 and MacOS-10.10.3 - The CocoaPods (v0.37.1) installation of the RealmSwift (v0.92.3) described here and here basically works, except the WatchKit Exte

1条回答
  •  失恋的感觉
    2021-01-27 08:42

    The Podfile above is actually the right one !!

    However, it is important that you still "import RealmSwift" in your Realm-Object definition(s) using CocoaPods as can be seen in the corrected example below. This will make your error messages of the WatchKit Extension not recognizing any realm-object go away !

    enter image description here

    Also, if you intend to use your Realm-Object in two targets (i.e. "MyApp" and "MyApp WatchKit Extension"), make sure you select both the corresponding targets in the target selection pane of your RealmObject.swift file (see image below):

    enter image description here

    0 讨论(0)
提交回复
热议问题