摘要:
代码如下:void *threadProcessFunction(void *ptr){printf("enter thread\n");//do thread thing//exit threadprintf("exit thread\n");return NULL;}void startRequestThread(){ // Create the thread using POSIX routines. pthread_attr_t attr; pthread_t posixThreadID; int returnVal; returnVal = p 阅读全文
摘要:
1、到苹果管网下载Reachability的Demo,https://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html然后把:Reachability.h 和Reachability.m 添加到工程中2、使用如下方法就能判断当前是否联网:bool CCNetworkConfig::isNetworkAvailable(){ Reachability *r = [ReachabilityreachabilityWithHostName:@"www.apple.com" 阅读全文