我已经插入了我的第一个数据。我的问题是当我去插入下一个数据时,循环从第一个数据开始计数并以最后一个数据结束
-(void)GetAllSplitDataHandler:(id)value {
int j;
// NSError error;
if([value isKindOfClass:[NSError class]])
{
NSLog(@"%@", value); return;
}
// Handle faults
if([value isKindOfClass:[SoapFault class]])
{
NSLog(@"%@", value);
return;
}
NSMutableArray result = (NSMutableArray*)value;
NSLog(@"GetAllAtheleteHandler returned the value: %@", result );
if([[NSString stringWithFormat:@"%@",result] isEqualToString:@"1"]){
NSLog(@"Result Count :: %d",[result count]);
for (int i =0; i<[result count]; i++) {
NSMutableDictionary *dic=[[NSMutableDictionary alloc]init];
[dic setValue:[[result objectAtIndex:0] valueForKey:@"entity1"] forKey:@"entity1"];
[dic setValue:[[result objectAtIndex:0] valueForKey:@"entity2"] forKey:@"entity2"];
DAL *objDAL=[[DAL alloc]initDatabase:@"Abc.sqlite"];
j = [objDAL insertRecord1:dic inTable:@"Abc"];
if (j == 0) {
NSLog(@"Inserted Successfully");
}
else if(j == -1)
{
NSLog(@"Insertion Failed");
// NSAssert1(0, @"Insertion Failure '%@'.", [error localizedDescription]);
}
}
}