我设置了我的计时器代码,它都是犹太洁食,但我希望我的标签显示"分钟:秒"而不是秒.
-(void)countDown{
time -= 1;
theTimer.text = [NSString stringWithFormat:@"%i", time];
if(time == 0)
{
[countDownTimer invalidate];
}
}
Run Code Online (Sandbox Code Playgroud)
我已经将"时间"设置为600或10分钟.但是,我希望显示屏显示10:59,10:58等,直到它达到零.
我该怎么做呢?
谢谢!
我目前正在编写一个应用程序,它可以扩展后端引入的数据.为了测试这种可伸缩性,我目前正在使用plists来引入一些基本数据.
为了性别/视觉目的(目前使用颜色),计划最终会在用户名旁边显示男/女图标,但是,在正确的tableView方法中编写条件语句后,应用程序似乎完全跳过这些参数.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
SelectProfileCell *cell = (SelectProfileCell *) [tableView dequeueReusableCellWithIdentifier:@"SelectProfileCell"];
NSArray *array = [[NSArray alloc] initWithArray:[userArray objectAtIndex:indexPath.row]];
cell.nameLabel.text = [array objectAtIndex:0];
gender = [array objectAtIndex:1];
if(gender == @"Male"){
cell.genderLogo.backgroundColor = [UIColor blueColor];
NSLog(@"Male");
}
if(gender == @"Female"){
cell.genderLogo.backgroundColor = [UIColor greenColor];
NSLog(@"Female");
}
return cell;
}
Run Code Online (Sandbox Code Playgroud)
在这种情况下,userArray和gender都是已经初始化的实例变量."userArray"已经从属性列表中传递了相应的2D Array数据(使用控制台来检查).
同样,日志没有显示"Male"/"Female"调试消息,因此出于某种原因正在跳过这些"if"语句.有什么建议?
谢谢!