我试图用多个部分填充uitableview.这是我的代码:
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
case 1:
[[cell textLabel] setText:[usersTeachers objectAtIndex:(indexPath.row+1)]];
return cell;
break;
Run Code Online (Sandbox Code Playgroud)
我尝试加载视图时收到此错误:
2009-12-28 21:09:48.380 FSS[2046:207] *** Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit/UIKit-984.38/UITableView.m:4709
2009-12-28 21:09:48.381 FSS[2046:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
Run Code Online (Sandbox Code Playgroud)
该索引处的数组记录为合法字符串,但不会正确返回单元格.因此它不会超过这一点.请帮忙.
我有兴趣创建一种方法来查找当前日期是否在任何给定日期的特定时间之间.这是一个调度程序,所以我想找到当前发生的事件.每天都有相同的时间:820-900,900-940,940-1020等.由于这必须在任何一天完成,我不知道如何在一定时间内创建NSDate.我想这可能是用NSTimeInterval完成的,但我不确定如何实例化它.