简体   繁体   English

Objective-c 使用 cocoapods 添加 Swift 框架未找到文件

[英]objective-c use cocoapods add Swift framework not found file

I'm working on an objective-c project.我正在做一个objective-c 项目。 I added a swift framework, which gave me errors.我添加了一个 swift 框架,这给了我错误。 When I touch "command" can find the file.当我触摸“命令”时可以找到该文件。 When I use #import also can add "ChartLineView.swift".当我使用#import 时也可以添加“ChartLineView.swift”。 But when I implement it as,但是当我实现它时,

ChartLineView *cl = ....

I get an error, " Use of undeclared identifier LineChartView " What could be wrong?我收到一个错误,“使用未声明的标识符LineChartView ” 什么可能是错误的?

I guess your are having issue in importing swift library(added via cocoapods) in your Objective C project.我猜您在 Objective C 项目中导入 swift 库(通过 cocoapods 添加)时遇到问题。 Just go in your .m file and import the swift library like this.只需进入您的 .m 文件并像这样导入 swift 库。

@import LineChartView; // i suppose  LineChartView is the swift library name.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM