https://github.com/yeahdongcn/rsbmobwrapper
Bmob http://www.codenow.cn/ 是一个专门为移动应用程序开发提供所有必须的后端服务的产品(相当于Parse国内版)。从简单的数据存储到复杂的用户管理,数据分析,所有的功能都是为程序开发人员精心制作。无论多么复杂的后端,Bmob都提供了超级简单的原生软件开发工具包和API。来一起了解Bmob的特点和几行代码,您可在数分钟内开始运作你的移动应用。这个Repo提供了新的基类和Bmob相关内容的封装。
https://github.com/yeahdongcn/rsbmobwrapper
Last synced: over 1 year ago
JSON representation
Bmob http://www.codenow.cn/ 是一个专门为移动应用程序开发提供所有必须的后端服务的产品(相当于Parse国内版)。从简单的数据存储到复杂的用户管理,数据分析,所有的功能都是为程序开发人员精心制作。无论多么复杂的后端,Bmob都提供了超级简单的原生软件开发工具包和API。来一起了解Bmob的特点和几行代码,您可在数分钟内开始运作你的移动应用。这个Repo提供了新的基类和Bmob相关内容的封装。
- Host: GitHub
- URL: https://github.com/yeahdongcn/rsbmobwrapper
- Owner: yeahdongcn
- License: mit
- Created: 2014-03-16T13:28:30.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-30T03:18:42.000Z (over 12 years ago)
- Last Synced: 2025-03-27T14:55:18.241Z (over 1 year ago)
- Language: Objective-C
- Homepage:
- Size: 1.03 MB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
BmobWrapper
===========
#突然发现AVOS AVOS on Github这些功能都实现了!!!
提供了新的基类和Bmob相关内容的封装,好处在于减少了UI层面key-value的操作,直接可以用property中定义的名字get/set值。
统一了存储和更新,因为存储和更新对我们来说都是存,区分这俩感觉有点外行,不过这接口和Parse的确实是一样,不管他们怎么想我需要的是统一的接口。
例子已经上传。
// 0. SAVE
__block RSGameScore *gs0 = [[RSGameScore alloc] init];
gs0.score = 1200;
gs0.userName = @"xiaoming";
gs0.cheatMode = NO;
gs0.age = 18;
[gs0 saveWithCallback:^(BmobObject *bmobObject, BOOL succeeded, NSError *error) {
if (bmobObject) {
gs0 = [[RSGameScore alloc] initWithBmobObject:bmobObject];
NSLog(@"gs0 save succeeded = %d, error = %@", succeeded, error);
NSLog(@"gs0 score=%d", gs0.score);
NSLog(@"gs0 userName=%@", gs0.userName);
NSLog(@"gs0 cheatMode=%d", gs0.cheatMode);
NSLog(@"gs0 age=%d", gs0.age);
}
}];
// 1. SAVE THEN DELETE
__block RSGameScore *gs1 = [[RSGameScore alloc] init];
gs1.score = 1500;
gs1.userName = @"xiaozhang";
gs1.cheatMode = NO;
gs1.age = 20;
[gs1 saveWithCallback:^(BmobObject *bmobObject, BOOL succeeded, NSError *error) {
if (bmobObject) {
gs1 = [[RSGameScore alloc] initWithBmobObject:bmobObject];
NSLog(@"gs1 save succeeded = %d, error = %@", succeeded, error);
NSLog(@"gs1 score=%d", gs1.score);
NSLog(@"gs1 userName=%@", gs1.userName);
NSLog(@"gs1 cheatMode=%d", gs1.cheatMode);
NSLog(@"gs1 age=%d", gs1.age);
[gs1 deleteWithCallback:^(BOOL succeeded, NSError *error) {
NSLog(@"gs1 delete succeeded = %d, error = %@", succeeded, error);
}];
}
}];
// 2. SAVE THEN UPDATE
__block RSGameScore *gs2 = [[RSGameScore alloc] init];
gs2.score = 1800;
gs2.userName = @"xiaowang";
gs2.cheatMode = NO;
gs2.age = 22;
[gs2 saveWithCallback:^(BmobObject *bmobObject, BOOL succeeded, NSError *error) {
if (bmobObject) {
gs2 = [[RSGameScore alloc] initWithBmobObject:bmobObject];
NSLog(@"gs2 save succeeded = %d, error = %@", succeeded, error);
NSLog(@"gs2 score=%d", gs2.score);
NSLog(@"gs2 userName=%@", gs2.userName);
NSLog(@"gs2 cheatMode=%d", gs2.cheatMode);
NSLog(@"gs2 age=%d", gs2.age);
gs2.age = 100;
[gs2 saveWithCallback:^(BmobObject *bmobObject, BOOL succeeded, NSError *error) {
gs2 = [[RSGameScore alloc] initWithBmobObject:bmobObject];
NSLog(@"gs2 age=%d", gs2.age);
}];
}
}];
// 3. QUERY
[RSBmobWrapper getObjectsWithClassName:kRSGameScoreClassName withPreparation:nil
withCallback:^(NSArray *list, NSError *error) {
NSLog(@"QUERY>>>>>");
for (BmobObject *object in list) {
RSGameScore *gs = [[RSGameScore alloc] initWithBmobObject:object];
NSLog(@"gs score=%d", gs.score);
NSLog(@"gs userName=%@", gs.userName);
NSLog(@"gs cheatMode=%d", gs.cheatMode);
NSLog(@"gs age=%d", gs.age);
}
NSLog(@"<<<<>>>>");
for (BmobObject *object in list) {
RSGameScore *gs = [[RSGameScore alloc] initWithBmobObject:object];
NSLog(@"gs score=%d", gs.score);
NSLog(@"gs userName=%@", gs.userName);
NSLog(@"gs cheatMode=%d", gs.cheatMode);
NSLog(@"gs age=%d", gs.age);
}
NSLog(@"<<<<