Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
liberalisman committed Jul 17, 2018
1 parent 0df8e2f commit 2ea1f44
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Foundation/15.第十五题.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## 如何将 `Obj-C` 代码改变为 `C++/C` 的代码?

```
// 在当前路径下执行
clang rewrite-objc main.m -o main.cpp
```
上面的方法会生成不同平台下的源代码,大约有10万行,但我们只想要 iOS 平台下的相关代码,我们可取以下的方式:


```
// xcrun == Xcode Run
// -sdk 指定系统平台
// -arch 指定的架构
xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc main.m -o main-arm64.cpp
```



2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
- 22.是否了解 `Type Encoding`? - [链接](https://github.com/liberalisman/iOS-InterviewQuestion-collection/blob/master/Runtime/22.第二十二题.md)
- 23.`Objective-C` 如何实现多重继承? - [链接](https://github.com/liberalisman/iOS-InterviewQuestion-collection/blob/master/Runtime/23.第二十三题.md)
- 24.`Category` 可不可以添加实例对象?为什么? - [链接](https://github.com/liberalisman/iOS-InterviewQuestion-collection/blob/master/Runtime/24.第二十四题.md)
- 25.`Obj-c`对象、类的本质是通过什么数据结构实现的?


## Runloop
Expand Down Expand Up @@ -207,6 +208,7 @@
- 12.`typeof``__typeof``__typeof__` 的区别? - [链接](https://github.com/liberalisman/iOS-InterviewQuestion-collection/blob/master/Foundation/12.第十二题.md)
- 13.如何判断一个文件在沙盒中是否存在?
- 14.头文件导入的方式? - [链接](https://github.com/liberalisman/iOS-InterviewQuestion-collection/blob/master/Foundation/14.第十四题.md)
- 15.如何将 `Obj-C` 代码改变为 `C++/C` 的代码?- [链接](https://github.com/liberalisman/iOS-InterviewQuestion-collection/blob/master/Foundation/15.第十五题.md)

## 网络
- 1.`NSUrlConnect`相关知识。
Expand Down

0 comments on commit 2ea1f44

Please sign in to comment.