小编Mic*_*ael的帖子

UITableView:加载所有单元格

是否有可能在加载视图时加载UITableView的所有单元格,以便在我滚动时不加载它们?(这样做时我会显示一个加载屏幕)

拜托,这是我项目的唯一方式(抱歉太复杂,无法解释为什么^^)

编辑:

好的,让我解释一下,我明确在做什么:

- (UITableViewCell *)tableView:(UITableView *)tableView
     cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
   NSString *cellIdentifier = [NSString stringWithFormat:@"Identifier %i/%i", indexPath.row, indexPath.section];
   CustomTableCell *cell = (CustomTableCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
   NSDictionary *currentReading;

   if (cell == nil)
   {
       cell = [[[CustomTableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];

       UILabel *label;
       UIView *separator;

       if(indexPath.row == 0)
       {
           // Here I'm creating the title bar of my "table" for each section
       }
       else
       {
           int iPr = 1;

           do
           {
               currentReading = [listData objectAtIndex:iPr-1];
               iPr++;
           } while (![[currentReading valueForKey:@"DeviceNo"] isEqualToString:[devicesArr objectAtIndex:indexPath.section]] …
Run Code Online (Sandbox Code Playgroud)

xcode objective-c uitableview viewdidload

3
推荐指数
2
解决办法
9337
查看次数

标签 统计

objective-c ×1

uitableview ×1

viewdidload ×1

xcode ×1