如何使用CocoaPods正确安装ReactiveCocoa? [英] How to install ReactiveCocoa properly using CocoaPods?

查看:95
本文介绍了如何使用CocoaPods正确安装ReactiveCocoa?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 ReactiveCocoa 很陌生。几天前,我尝试通过 CocoaPods 安装 ReactiveCocoa
这是我的 podFile

I'm very new to ReactiveCocoa. I tried to install ReactiveCocoa a couple of days ago via CocoaPods. Here is my podFile:

platform :ios , '7.0'
pod 'ReactiveCocoa'

使用 pod安装后我在这里有日志文件:

After using pod install I have the log file here:


分析依赖项

Analyzing dependencies

下载依赖项

使用ReactiveCocoa(2.0)

Using ReactiveCocoa (2.0)

生成Pod项目

集成客户端项目

然后打开 myproject.xworkspace #import< ReactiveCocoa.h> 开始使用框架。
但是问题是我无法正常工作

And then I open myproject.xworkspace and #import <ReactiveCocoa.h> to start using the framework. But the problem is I cannot get it worked

例如,在我的代码中,这行代码是:
objc
RACSignal * usernameSignal = self._usernameTextField.rac_textSignal;

但是,当我运行项目时,它显示了此调试错误

For example in my code I have this line: objc RACSignal *usernameSignal = self._usernameTextField.rac_textSignal; But when I run the project, it showed up this debug error


由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[UITextField rac_textSignal]:无法识别的选择器已发送到实例0xb933a70'

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITextField rac_textSignal]: unrecognized selector sent to instance 0xb933a70'

I相信我在这里安装框架可能做错了。有人请帮帮我!

I believed that I might do something wrong with the framework installation here. Anyone please help me out!

我正在使用 XCode5和iOS7.0

推荐答案

我发现了问题所在。这是因为CocoaPods没有在我的项目构建设置中添加标志 -all_load 。手动设置后,它就像一个超级按钮。
希望这可以帮助像我一样遇到相同问题的每个人

I figured out the issues. It's because CocoaPods doesn't add the flag -all_load in my project build setting. After setting it manually, it works like a charm. Hope this help everyone who experience the same issue like me

这篇关于如何使用CocoaPods正确安装ReactiveCocoa?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆