在一个呼叫Backendless中添加多个记录

时间:2016-06-28 21:17:35

标签: ios objective-c backendless

任何人都可以帮助我,我有这个循环,它工作正常,几个周期但有时大数据丢失,我不认为这可能是实现它的最好方法....

for (int i = 0; i < [allTableData count]; i++) {
    item = [allTableData objectAtIndex:i];
    qut1.DocEntry = uuid;
    qut1.Status = @"O";
    qut1.ItemCode = item.code;
    qut1.Dscription = item.name;
    qut1.Quantity = item.quantity;
    qut1.UoM = item.uom;
    qut1.Price = item.price;
    qut1.LineTotal = item.linetotal;
    id<IDataStore> dataStore = [backendless.persistenceService of:[QUT1 class]];
    [dataStore save:qut1 responder:nil];
}

QUT1.h

@interface QUT1 : NSObject

  @property (nonatomic, strong) NSString *objectId;
  @property (nonatomic, strong) NSString *DocEntry;
  @property (nonatomic, strong) NSString *Status;
  @property (nonatomic, strong) NSString *ItemCode;
  @property (nonatomic, strong) NSString *Dscription;
  @property (nonatomic) int Quantity;
  @property (nonatomic, strong) NSString *UoM;
  @property (nonatomic) double Price;
  @property (nonatomic) double LineTotal;
@end

有人能提出更好的解决方案吗?

谢谢。

1 个答案:

答案 0 :(得分:0)