|
|
|
|
|
|
|
|
}*/ |
|
|
}*/ |
|
|
|
|
|
|
|
|
for(KAIBatteryCell *cell in addedCells) { |
|
|
for(KAIBatteryCell *cell in addedCells) { |
|
|
if(![devices containsObject:cell.device]) { |
|
|
|
|
|
cell.device = nil; |
|
|
|
|
|
[cell removeFromSuperview]; |
|
|
|
|
|
[self.displayingDevices removeObject:cell.label.text]; //lmaoo |
|
|
|
|
|
|
|
|
if(cell.device!=nil) { |
|
|
|
|
|
NSString *cellName = MSHookIvar<NSString *>(cell.device, "_name"); |
|
|
|
|
|
if(![addedCells containsObject:cellName]) { |
|
|
|
|
|
cell.device = nil; |
|
|
|
|
|
[cell removeFromSuperview]; |
|
|
|
|
|
[self.displayingDevices removeObject:cell.label.text]; //lmaoo |
|
|
|
|
|
} else { |
|
|
|
|
|
[cell updateInfo]; |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
[cell updateInfo]; |
|
|
|
|
|
|
|
|
//[cell removeFromSuperview]; |
|
|
|
|
|
//[addedCells removeObject:cell]; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if(!shouldAdd) { |
|
|
} else if(!shouldAdd) { |
|
|
|
|
|
|
|
|
if([self.displayingDevices containsObject:deviceName]) { |
|
|
if([self.displayingDevices containsObject:deviceName]) { |
|
|
|
|
|
cell.device = nil; |
|
|
[cell removeFromSuperview]; |
|
|
[cell removeFromSuperview]; |
|
|
[self.displayingDevices removeObject:deviceName]; |
|
|
[self.displayingDevices removeObject:deviceName]; |
|
|
|
|
|
[addedCells removeObject:cell]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |