iOS 判断字符串中含有某个字符串 rangeOfString&GCD写倒计时

//判断roadTitleLab.text 是否含有Kris 

if([roadTitleLab.text rangeOfString:@"Kris"].location !=NSNotFound)

//_roaldSearchText { NSLog(@"yes");

} else {

NSLog(@"no");

​ }

//GCD 写的  倒计时

double delayInSeconds = 30.0;

dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));

dispatch_after(popTime, dispatch_get_main_queue(), ^(void){

NSLog(@"Bluetooth scan for 30 seconds");

[self.manager stopScan];

});

你可能感兴趣的:(iOS 判断字符串中含有某个字符串 rangeOfString&GCD写倒计时)