//2 Number group de-weight method encapsulation , returns a new array , adds a new object that is not duplicated -( the number becomes more )
-(nsmutablearray *) Quchongwitholdarr: (nsmutablearray *) Oldarr Addnewarr: (nsarray *) newArr
{
nsmutablearray *resultarr = [nsmutablearrayarray];
for (vshowroomobject * newroom in NEWARR) {
BOOL isexit = NO;
for (vshowroomobject * oldroom in oldarr) { /c9>
if ([Newroom. roomidisequal: Oldroom. roomid]) {
// repeat
Isexit = YES;
}
}
if (!isexit) {
// non-repeating
[Resultarr addobject: newroom];
}
}
return Resultarr;
}
//2 Number group de-weight method encapsulation , returns the new array , removes the duplicate old objects -( fewer numbers )
-(nsmutablearray *) Quchongwitholdarr: (nsarray *) Oldarr Removenewarr: (nsmutablearray *) newArr
{
nsmutablearray *resultarr = [nsmutablearrayarraywitharray : Oldarr];
for (vshowroomobject * newroom in NEWARR) {
BOOL isexit = NO;
for (vshowroomobject * oldroom in oldarr) { /c9>
if ([Newroom. roomidisequal: Oldroom. roomid]) {
// repeat
Isexit = YES;
[Resultarr removeobject: oldroom];
}
}
if (!isexit) {
// non-repeating
}
}
return Resultarr;
}
Add new array to redo MJ Refresh data with