摘要: 代码如下: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 阅读全文
posted @ 2012-02-06 17:10 MXi4oyu 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 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" 阅读全文
posted @ 2012-02-06 17:04 MXi4oyu 阅读(206) 评论(0) 推荐(0) 编辑