摘要: 如题,判断程序是否是第一次运行,这里用了一种方法,还是基于NSUserDefaults的。。。很简单,贴代码在didFinishLaunchingWithOptions用这种方法做设置- (void)LaunchJudge{ if (![[NSUserDefaults standardUserDefaults] boolForKey:@"everLaunched"]) { [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"everLaunched"]; [[NSUserDefaults 阅读全文
posted @ 2013-08-17 11:20 15.10 阅读(210) 评论(0) 推荐(0) 编辑
摘要: UISwitch是个好东西,话不多说,上代码 UISwitch *switchButton = [[UISwitch alloc] initWithFrame:CGRectMake(50, 100, 0, 0)]; [switchButton setOn:YES]; [switchButton addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventValueChanged]; [self.view addSubview:switchButton]; [switch... 阅读全文
posted @ 2013-08-17 10:07 15.10 阅读(180) 评论(0) 推荐(0) 编辑
摘要: NSURLConnection的超时时间是240s,时间太长了。。。。如果用get或者没设置setHTTPMethod,可以使用timeoutInterval 方法上图 //NSMutableURLRequest *urlRequest = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10]; req.timeoutInterval = 10.0;如果是post,就需要另寻它法了见:http://ww... 阅读全文
posted @ 2013-08-17 09:26 15.10 阅读(431) 评论(0) 推荐(0) 编辑