【问题标题】:Swift Use of unresolved identifier 'RealmApp'快速使用未解析的标识符“RealmApp”
【发布时间】:2020-07-06 10:24:50
【问题描述】:

我正在关注这个 Realm ios SDK 快速入门 https://docs.mongodb.com/realm/ios/quick-start/

这是我的快速代码

import Foundation
import SwiftUI
import RealmSwift
import UIKit



let app = RealmApp(id: "xxxx")

但是我一直收到这个错误

使用未解析的标识符“RealmApp”

这是我的 pod 文件

  # Uncomment the next line to define a global platform for your 

项目 平台:ios,'12.0'

  target 'Emma' do
   # Comment the next line if you don't want to use dynamic frameworks
   use_frameworks!

   # Pods for Emma
   pod 'Firebase'
   pod 'RealmSwift', '=10.0.0-beta.2'

   target 'EmmaTests' do
     inherit! :search_paths
    # Pods for testing
   end

    target 'EmmaUITests' do
      # Pods for testing
    end

    end

RealmSwift 模块已通过 pod 文件安装。我不知道如何解决这个问题,因为这是快速入门中列出的内容。

【问题讨论】:

  • 您使用的是哪个版本的 Realm?您是否按照说明here

标签: swift realm mongodb-realm


【解决方案1】:

我遇到了同样的错误。在某些时候,let app = RealmApp(id: "xxxx") 似乎已更改为 let app = App(id: "xxxx")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-12
    • 1970-01-01
    相关资源
    最近更新 更多