BmobObject Class Reference

Inherits from NSObject
Declared in BmobObject.h

Other Methods

  objectId

 BmobObject对象的id
@property (nonatomic, copy) NSString *objectId

Declared In

BmobObject.h

  updatedAt

 BmobObject对象的最后更新时间
@property (nonatomic, strong) NSDate *updatedAt

Declared In

BmobObject.h

  createdAt

 BmobObject对象的生成时间
@property (nonatomic, strong) NSDate *createdAt

Declared In

BmobObject.h

  className

BmobObject对象的表名

@property (nonatomic, copy) NSString *className

Declared In

BmobObject.h

  ACL

权限控制里列表

@property (nonatomic, strong) BmobACL *ACL

Declared In

BmobObject.h

+ objectWithClassName:

创建一个带有className的BmobObject对象
+ (instancetype)objectWithClassName:(NSString *)className

Parameters

className

表示对象名称(类似数据库表名)

Return Value

BmobObject

Declared In

BmobObject.h

+ objectWithoutDatatWithClassName:objectId:

创建一个带有className 和objectId的BmobObject对象

+ (instancetype)objectWithoutDatatWithClassName:(NSString *)className objectId:(NSString *)objectId

Parameters

className

表名

objectId

对象的id

Return Value

BmobObject对象

Declared In

BmobObject.h

– initWithClassName:

通过对象名称(类似数据库表名)初始化BmobObject对象
- (id)initWithClassName:(NSString *)className

Parameters

className

表示对象名称(类似数据库表名)

Return Value

BmobObject

Declared In

BmobObject.h

– initWithDictionary:

从字典创建BmobObject

- (instancetype)initWithDictionary:(NSDictionary *)dictionary

Parameters

dictionary

字典

Return Value

BmobObject 对象

Declared In

BmobObject.h

– setObject:forKey:

向BmobObject对象添加数据
- (void)setObject:(id)obj forKey:(NSString *)aKey

Parameters

obj

数据

aKey

Declared In

BmobObject.h

– addRelation:forKey:

为列创建关联关系

- (void)addRelation:(BmobRelation *)relation forKey:(id)key

Parameters

relation

关联关系

key

Declared In

BmobObject.h

– saveAllWithDictionary:

批量向BmobObject添加数据,可与 -(void)setObject:(id)obj forKey:(NSString*)aKey;一同使用

- (void)saveAllWithDictionary:(NSDictionary *)dic

Parameters

dic

数据

Declared In

BmobObject.h

– objectForKey:

得到BombObject对象某个列的值
- (id)objectForKey:(id)aKey

Parameters

aKey

列名

Return Value

该列的值

Declared In

BmobObject.h

– deleteForKey:

删除BmobObject对象的某列的值

- (void)deleteForKey:(id)key

Parameters

key

列名

Declared In

BmobObject.h

– addObjectsFromArray:forKey:

向给定的列添加数组

- (void)addObjectsFromArray:(NSArray *)objects forKey:(NSString *)key

Parameters

objects

想要添加的数组

key

给定的列名

Declared In

BmobObject.h

– addUniqueObjectsFromArray:forKey:

向给定的列添加数组,只会在原本数组字段中没有这些对象的情形下才会添加入数组

- (void)addUniqueObjectsFromArray:(NSArray *)objects forKey:(NSString *)key

Parameters

objects

想要添加的数组

key

给定的列名

Declared In

BmobObject.h

– removeObjectsInArray:forKey:

从一个数组字段的值内移除指定的数组中的所有对象

- (void)removeObjectsInArray:(NSArray *)objects forKey:(NSString *)key

Parameters

objects

想要移除的数组

key

给定的列名

Declared In

BmobObject.h

– incrementKey:

列的值+1

- (void)incrementKey:(NSString *)key

Parameters

key

列名

Declared In

BmobObject.h

– incrementKey:byAmount:

列的值加 amount

- (void)incrementKey:(NSString *)key byAmount:(NSInteger)amount

Parameters

key

列的值

amount

增加的数值

Declared In

BmobObject.h

– decrementKey:

列的值-1

- (void)decrementKey:(NSString *)key

Parameters

key

列名

Declared In

BmobObject.h

– decrementKey:byAmount:

列的值减 amount

- (void)decrementKey:(NSString *)key byAmount:(NSInteger)amount

Parameters

key

列的值

amount

减去的数值

Declared In

BmobObject.h

– saveInBackground

后台保存BmobObject对象,没有返回结果
- (void)saveInBackground

Declared In

BmobObject.h

– saveInBackgroundWithResultBlock:

后台保存BmobObject对象,返回保存的结果
- (void)saveInBackgroundWithResultBlock:(BmobBooleanResultBlock)block

Parameters

block

返回保存的结果是成功还是失败

Declared In

BmobObject.h

– updateInBackground

后台更新BmobObject对象,没有返回结果
- (void)updateInBackground

Declared In

BmobObject.h

– updateInBackgroundWithResultBlock:

后台更新BmobObject对象
- (void)updateInBackgroundWithResultBlock:(BmobBooleanResultBlock)block

Parameters

block

返回更新的结果是成功还是失败

Declared In

BmobObject.h

– deleteInBackground

后台删除BmobObject对象,没有返回结果
- (void)deleteInBackground

Declared In

BmobObject.h

– deleteInBackgroundWithBlock:

后台删除BmobObject对象
- (void)deleteInBackgroundWithBlock:(BmobBooleanResultBlock)block

Parameters

block

返回删除的结果是成功还是失败

Declared In

BmobObject.h

Subclass Methods

– sub_saveInBackground

保存数据

- (void)sub_saveInBackground

Declared In

BmobObject+Subclass.h

– sub_saveInBackgroundWithResultBlock:

保存数据

- (void)sub_saveInBackgroundWithResultBlock:(BmobBooleanResultBlock)block

Parameters

block

结果回调

Declared In

BmobObject+Subclass.h

– sub_updateInBackground

更新数据

- (void)sub_updateInBackground

Declared In

BmobObject+Subclass.h

– sub_updateInBackgroundWithResultBlock:

更新数据

- (void)sub_updateInBackgroundWithResultBlock:(BmobBooleanResultBlock)block

Parameters

block

结果回调

Declared In

BmobObject+Subclass.h

– initFromBmobObject:

把bmobobject对象转成子类,对BmobObject,BmobUser,BmobRole,BmobInstallation的子类有效

- (instancetype)initFromBmobObject:(BmobObject *)obj

Parameters

obj

BmobObject对象

kClass

父类的class

Return Value

子类的对象

Declared In

BmobObject+Subclass.h