简体   繁体   中英

UITableView scrolling is choppy in iOS Simulator

Here is a video with logging the index path in cell for row at index path: (see new link below)

So, another weird one... On my home iMac (brand new), when I run an Xcode project in the simulator for the first time, it runs fine. If I then quit out of the simulator and Xcode and then open up Xcode again and run it - (think of this as starting to work on the project again another day) - When I attempt to scroll any uitableview, the simulator redraws ALL the cells (it doesn't seem to dequeue and reuse correctly). I know this because I am running NSLog when the cell is being drawn.

If I reset the setting in the simulator and then run it again - it scrolls smoothly. I've tried completely uninstalling Xcode and reinstalling it to no avail. I'm using Xcode 4.3.2.

Now, one might assume that this is something with the code BUT, get this: I have another (brand new iMac) at the office. I have this Xcode project on dropbox so both copies are the same (office and home). In the office, I do NOT have this weird scrolling problem... everything works correctly.

The only difference between the two macs (both are 27 inch and have 16gb RAM) is the hdd - The office mac has a 1tb 7200 RPM drive. My home mac has an SSD from Apple.

I have no clue what could be causing this... It's REALLY frustrating. I'm not against wiping my home mac and starting over but that's a bit drastic.

Thoughts? I didn't post code because running the same code on 2 different computers yields different results, so the code doesn't seem to be the issue.

UPDATING WITH CODE - and video http://ge.tt/4ZuZ9mI/v/0

       - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

            static NSString *CellIdentifier = @"dateCell";

            FEDateCell *cell = (FEDateCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
            if (cell == nil) {
                [[NSBundle mainBundle] loadNibNamed:@"FEDateCell" owner:self options:nil];
                cell = dateCell; 
                [cell setClipsToBounds:YES];
            }
            PFObject *eventObj = [self.itemsList objectAtIndex:indexPath.row];
            //Get cell date from row
            NSDate *currentDate = [eventObj objectForKey:@"startDate"];

            cell.cellDate = currentDate;
            cell.eventsArray = [NSArray arrayWithObject:eventObj];

            [dateFormatter setDateFormat:@"dd"];
            cell.dayNumber.text = [dateFormatter stringFromDate:cell.cellDate];
            [dateFormatter setDateFormat:@"EEE"];
            cell.dayName.text = [dateFormatter stringFromDate:cell.cellDate];


            [cell updateCellData];

            return cell;
        }

After much deliberation, I decided to completely wipe the iMac and do a clean install.
Now, while I JUST performed the clean install (which, in affect, would be the same as resetting the content and settings in iOS simulator) - it appears that the issue has gone away. Now, I'm not certain of this as I just performed the clean install, but again, I have closed and reopened Xcode multiple times, rebooted a few times and the issue has not returned.

REALLY annoying that it came to formatting the system and starting from scratch, but whatever. At least it's working.

如果事情按照您描述的方式发生,请考虑向Apple 报告错误。

尝试安装最新版本的显卡驱动程序

I don't think there is enough information here to determine what the problem is. I think the best way forward would be for you to use the Xcode profiling tools to track down where the problem might be. Also look at the graphical profiling tools to determine if excessive drawing is happening.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM