ios-charts:无法将库导入新项目

标签 ios xcode compilation linker ios-charts

我无法整合 the iOS-chart project/自定义项目中的库。

以下是我执行的步骤:

  • 在 Xcode 上打开演示应用程序
  • 在原始演示代码中找到图表库

enter image description here

  • 单击“在查找器中显示”并将项目复制到新项目
  • 新项目现在有 2 个目标。我检查包含 View (ChartIn) 的目标是否确实链接到库。确实如此。
  • 我编译库(在新项目中)
  • 然后我编译并运行 ChartIn,但出现以下错误:

dyld: Library not loaded: @rpath/Charts.framework/Charts Referenced from: /private/var/mobile/Containers/Bundle/Application/0C7EC6DC-94B6-4205-8E71-0F704B2A7523/ChartIn.app/ChartIn Reason: image not found

enter image description here

最佳答案

我只能引用:

为了正确编译:

Drag the Charts.xcodeproj to your project
Go to your target's settings, hit the "+" under the "Embedded Binaries" section, and select the Charts.framework
Temporary workaround: Xcode 6.3.1 has a bug, where you have to build your project once before actually writing the @import line. So hit "Build" now!
@import Charts
When using Swift in an ObjC project:
    You need to import your Bridging Header. Usually it is "YourProject-Swift.h", so in ChartsDemo it's "ChartsDemo-Swift.h". Do not try to actually include "ChartsDemo-Swift.h" in your project :-)
    Under "Build Options", mark "Embedded Content Contains Swift Code"

如果你想为 iOS 7 编译:

Drag the code itself (.swift files) to your project. As sadly, Swift currently does not support compiling Frameworks for iOS 7.
Make sure that the files are added to the Target membership.

关于ios-charts:无法将库导入新项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32630863/

相关文章:

iphone - 在 SQLite 中获取表中填充行的总数

ios - Google map GMSMaker iconView - iOS SDK

objective-c - "Failed to unarchive element named UITableViewController"

c - 如何调整/编辑编译 C 的终端 bash 脚本?

c++ - 如何编译peercoin来生成Windows二进制文件?

c - 如何避免c文件的重新编译?

ios - 图像不适合屏幕

ios - UICollectionView,全宽单元格,允许自动布局动态高度?

ios - parse.com swift - 取消固定和删除 tableView 单元格中的对象

ios - 如何在模拟器中更改高速公路行驶的轨道?