Skip to content
This repository has been archived by the owner on Jul 2, 2019. It is now read-only.

使用ChatKit OC调试AVOSCloud.framework

微博@iOS程序犭袁 edited this page Dec 29, 2016 · 3 revisions

#使用ChatKit-OC 调试AVOSCloud.framework

##步骤

需要几步:

1. 删除库(ChatKit) 对 CocoaPods 的依赖

将库(ChatKit) 的 Podfile 中依赖的第三方库(我整理了下放在 这里 了),以源文件的形式拖拽的 Demo 的Project中(ChatKit.project) 中,将.h文件设为 public,删除下面两个 section。

  1. target-->build Phases-->Check Pods Manifest.lock
  2. target-->build Phases-->Copy Pods Resources

确保Project能编译通过。 注意:不需要注释删除 Podfile 中的第三方库,因为下一步会不使用 CocoaPods 来建立库(ChatKit)与Demo(ChatKit-OC)的依赖。 ChatKit.project 的最低支持的 iOS 应该与 ChatKit-OC.project 保持一致。

第三方库不能再使用如下方法导入:

#import <ChatKit/LCChatKit.h>

必须要做检查:

#if __has_include(<ChatKit/LCChatKit.h>)
#import <ChatKit/LCChatKit.h>
#else
#import "LCChatKit.h"
#endif

AVOS.xcodeproj 拖拽后,还需要导入到下面几个地方:

  1. ChatKit target --> Build Phases --> Target Dependencies
  2. ChatKit target --> Build Phases --> Link Binary With Libraies、

2. 在 Demo(ChatKit-OC)的 podfile 中删除对 库(ChatKit) 的依赖

为 ChatKit 创建了一个 framework,将 ChatKit 的 project 拖拽到Demo(ChatKit-OC)的Project中。 然后 pod install

3. 在 Demo(ChatKit-OC)的如下三处Section添加 ChatKit.framework 文件:

  1. demo target --> Build Phases --> Target Dependencies

  2. demo target --> General --> Embedded binaries enter image description here (参考:add the ChatKit framework to the "Embedded binaries" section in the "General" tab of your app target OS X Framework Library not loaded: 'Image not found'

  3. demo target --> Build Phases --> Link Binary With Libraies、 注意:操作第二Section时,Xcode会自动配置第三个Section,如果发现第三个Section无法进行,请确保第一步【删除库(ChatKit) 对 CocoaPod s 的依赖】是否正确完成。

常见问题

过程中过程中出现问题,可以尝试,Quit Xcode,删 CocoaPods 库,profile.lock文件,在Xcode关闭状态下 pod install。