[Center sharedInstance].replace = NO;
for (int i=0; i < [Center sharedInstance].nDevices.count; i++) {
NSString *p = [[Center sharedInstance].nDevices objectAtIndex:i];
if ([p isEqualToString:peripheral.name]) {
NSLog(@"peripheral.name----%d-----%@",i,peripheral.name);
[[Center sharedInstance].nDevices replaceObjectAtIndex:i withObject:peripheral.name];
[Center sharedInstance].replace = YES;
}
}
if (![Center sharedInstance].replace&&peripheral.name!=nil) {
[[Center sharedInstance].nDevices addObject:peripheral.name];
}
for (int i=0; i < [Center sharedInstance].nDevices.count; i++) {
NSString *p = [[Center sharedInstance].nDevices objectAtIndex:i];
if ([p isEqualToString:peripheral.name]) {
NSLog(@"peripheral.name----%d-----%@",i,peripheral.name);
[[Center sharedInstance].nDevices replaceObjectAtIndex:i withObject:peripheral.name];
[Center sharedInstance].replace = YES;
}
}
if (![Center sharedInstance].replace&&peripheral.name!=nil) {
[[Center sharedInstance].nDevices addObject:peripheral.name];
}