//数组去重
+(NSMutableArray *) removeSameObject:(NSMutableArray *)array InOriginalArray:(NSMutableArray *)originalArray withKey:(NSString *)key
{
if(!originalArray || [originalArray count]<1)
{
return array;
}
if([array count] > 0)
{
for (int i=0; i<[array count]; i++)
{
NSDictionary *dic = [array objectAtIndex:i];
int Id = [[dic objectForKey:key] intValue];
for(int j=0; j<[originalArray count];j++)
{
NSDictionary *orginalDic = [originalArray objectAtIndex:j];
int Id_before = [[orginalDic objectForKey:key] intValue];
if(Id_before == Id)
{
[array removeObjectAtIndex:i];
i--;
break;
}
}
}
}
return array;
}