我有 3 个NSMutableArray
。我想比较NSMutableArray
三个中的两个并找到不同的索引并存储在另一个中NSMutableArray
。我想在第三个不保存时打印这句话NSmutableArray
。
这是我的代码,但它不起作用:
NSMutableArray *jsonArray = [[NSMutableArray alloc]init];
jsonArray = [dic objectForKey:@"Modified"];
NSMutableArray *sqliteArray = [[NSMutableArray alloc]init];
[sqliteArray addObjectsFromArray:ModiArray];
differentValue = [[NSMutableArray alloc]init];
//guys jsonArray and SqliteArray not different index
if ([jsonArray count] == [sqliteArray count])
{
for (int i = 0; i < [sqliteArray count]; i++)
{
if (![jsonArray[i] isEqual:sqliteArray[i]])
{
[differentValue addObject:[NSNumber numberWithInt:i+1]];
}
}
//My problem here!!! when I NSLog differentValue show me empty but when I write this code dont work
if (differentValue == NULL)
{
NSLog(@"this array is null");
}
}