简单的在工程中集成RAC

cocoa pods因为墙的原因一直不好用,按rac官方的说法一直集成不成功:

最后粗爆的把RAC的源代码直接拷贝到了工程中,解决方法如下:

1、将ReactiveCocoa目录拷贝到工程中,并加入工程中。

2、ReactiveCocoa.h中mac相关的类删除。并将#import <>的方式改成 #import ""方式

3、Build Phrases中,将RACObjCRuntime.m加上flag:-fno-objc-arc。


官方的说明:


Importing ReactiveCocoa


To add RAC to your application:


Add the ReactiveCocoa repository as a submodule of your application's repository.
Run script/bootstrap from within the ReactiveCocoa folder.
Drag and drop ReactiveCocoa.xcodeproj into your application's Xcode project or workspace.
On the "Build Phases" tab of your application target, add RAC to the "Link Binary With Libraries" phase.
On iOS, add libReactiveCocoa-iOS.a.
On OS X, add ReactiveCocoa.framework. RAC must also be added to any "Copy Frameworks" build phase. If you don't already have one, simply add a "Copy Files" build phase and target the "Frameworks" destination.
Add "$(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts/include" $(inherited) to the "Header Search Paths" build setting (this is only necessary for archive builds, but it has no negative effect otherwise).
For iOS targets, add -ObjC to the "Other Linker Flags" build setting.
If you added RAC to a project (not a workspace), you will also need to add the appropriate RAC target to the "Target Dependencies" of your application.
If you would prefer to use CocoaPods, there are some ReactiveCocoa podspecs that have been generously contributed by third parties.


To see a project already set up with RAC, check out C-41 or GroceryList, which are real iOS apps written using ReactiveCocoa.


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值