ios抓包用charles
监听iPhone上的https请求,要先在iPhone上用Safari访问安装证书
Error Messages should be of the form:
[Noun] Can't x because y. [Something is true. Try a thing.]
CocoaPods
安装:
sudo gem install cocoapods
使用:在项目目录下建个
Podfile
,内容如platform :ios, '7.0' inhibit_all_warnings! #禁止pods里的warnings pod 'Reachability', '~> 3.1.1'
然后
pod install
,打开生成的.xcworkspace
来使用
静态库
创建静态库,参见tutorial
- 若静态库中用到c++而父项目中没用到,则要在父项目的
Other Linker Flags
中添加-lc++
(静态库使用libc++
)或-lstdc++
(静态库使用libstdc++
),参见StackOverflow - 静态库只是
.o
文件的集合,用到的framework都得在父项目中重新link一遍
- 若静态库中用到c++而父项目中没用到,则要在父项目的
将静态库的
SL.xcodeproj
拖进父项目作为子项目的步骤:- 父项目的
Target Depedencies
和Link Binary With Libraries
中添加libSL.a
- 父项目的
Other Linker Flags
中添加-ObjC
>-ObjC
causes the linker to load every object file in the library that defines an Objective-C class or category. While this option will typically result in a larger executable (due to additional object code loaded into the application), it will allow the successful creation of effective Objective-C static libraries that contain categories on existing classes.
参见QA1490 - 父项目的
Header Search Paths
中添加静态库头文件所在的目录,记得选中recursive
- 父项目的
Link Binary With Libraries
中添加子项目用到的库
- 父项目的
ios上的framework只是对静态库及头文件的封装,动态库因security问题在appstore上被禁使用,所以ios上的framework就是static framework