When trying to use cocoapods with swift getting error: bridging header does not exist?

When trying to use cocoapods with swift getting error: bridging header does not exist?

我正在尝试使用 this ExpandingTableView pod. When I tried to use it in my project Expense, it didn't work, so I looked at this Whosebug post and followed the linked tutorial. 但现在出现错误:

error: bridging header '/Users/Monica/Documents/CS 4999/Project/Expense/Expense/Expense-Bridging-Header.h' does not exist

作为教程的一部分,您应该进入项目的构建设置并将密钥 Objective-C Bridging Header 编辑为 project_name/project_name-Bridging-Header.h(在我的例子中:Expense/Expense-Bridging-Header.h)。这就是我所做的 as you can see.

为了修复此错误,我将密钥 Objective-C Bridging HeaderExpense/Expense-Bridging-Header.h 编辑为 Expense/Header.hExpense-Bridging-Header.hBridging.h./Expense/Bridging.h,或./Expense/Expense-Bridging-Header.h。没有解决错误。

如果有人能告诉我为什么会发生这种情况以及如何解决这个问题,我们将不胜感激!


This is how the files in my project Expense are arranged in Xcode.

These are the files of ExpandingTableView pod in Xcode.

This is where Bridging.h is located on my computer.

我的播客文件:

# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'Expense' do
pod 'ExpandingTableView'
end

target 'ExpenseTests' do

end

target 'ExpenseUITests' do

end

如果您使用框架,则不再需要桥接 header。相反,您将直接在 swift 文件中导入框架,您将在其中使用它,如下所示:

import ExpandingTableView

class MyTableView: UITableViewController{}