Created
February 20, 2014 12:23
-
-
Save winglight/9112363 to your computer and use it in GitHub Desktop.
Bee框架学习笔记
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
第1天 配置开发环境 | |
---------- | |
1. 命令行:`git clone https://github.com/gavinkwoe/BeeFramework.git` | |
2. 在Xcode中创建新项目,随后按照bee的文档手工加入framework,services,发现编译错误,在群里下载了《从零开始建立基于Beeframework的iOS工程.pdf》,照做一遍还是不行,只好换cocoapod | |
3. 安装cocoapod,依次执行以下命令行: | |
``` | |
sudo gem update --system | |
sudo gem install cocoapods | |
pod setup | |
``` | |
最后一步很花时间,又没有进度提示,多等几分钟吧,如果有提示encode问题,执行:export LC_ALL="en_US.UTF-8"。 | |
4. 进入工程目录,建立文件Podfile,内容如下: | |
``` | |
platform :ios | |
pod 'BeeFramework', '~> 0.5' | |
``` | |
5. 定义scaffold工具需要的JSON文件,然后运行: | |
./scaffold schema build <JSON文件名> | |
6. 复制生成的.h和.mm文件到工程目录下,并在viewcontroller里面加入以下测试代码: | |
``` | |
- (void)testAPI | |
{ | |
API_COMPANY * capi = [API_COMPANY apiWithResponder:self]; | |
[capi send]; | |
} | |
- (void)API_COMPANY:(API_COMPANY *)capi | |
{ | |
if ( capi.succeed ) | |
{ | |
if ( nil == capi.resp ) | |
{ | |
capi.failed = YES; | |
return; | |
} | |
printf( "succeed\n" ); | |
} | |
else if( capi.failed ) | |
{ | |
printf( "failed\n" ); | |
} | |
} | |
``` | |
注意使用对应的API_XXX替换示例代码,另外,如果使用了enum值是整形的,那么需要手工修改引用枚举的类型为NSNumber *。 | |
> Written with [StackEdit](https://stackedit.io/). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment