# 06.OC老项目Swift混编的一些坑

## 01: 桥接后 `Unknown type name` 问题

* **场景:** 在桥接文件中添加了某`OC`类的引用 编译时报错

```swift
#import "XXX.h"
```

![](http://ohfpqyfi7.bkt.clouddn.com/15171929167561.jpg)

在桥接文件中添加`CoreLocation`库的引用依旧出现上述错误

```swift
#import "XXX.h"
#import <CoreLocation/CoreLocation.h>
```

* **解决方法:**

  将 `CoreLocation` 的引用置顶

```swift
#import <CoreLocation/CoreLocation.h>
#import "XXX.h"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ryukiedev.gitbook.io/wiki/swift/oc-lao-xiang-mu-swift-hun-bian-de-yi-xie-keng.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
