UITableView Scroll issue with 100% cpu usage static

Hi to all!


I'm new on Apple Developer Program so I'm sorry for any bad-practise on this Forum.


I'm testing our applications on iOS 11 beta 8 (Xcode beta 6) and I'm getting stuck with an Hard issue on UITableView.


The scenario is:


# We have a 500+ rows on a UITableView with 8 columns.

# When we scroll there is no issue, when the table stop scrolling the cpu usage jump up to 100%.

# If we have scrolled a small number of rows the cpu usage drop down after one second.

# If we scroll at half table the cpu usage jumps to 100% and never go down.


It seems to be a problem with CoreFoundation while animating the scroll, here there is the instruments record:


https://www.dropbox.com/sh/mk13pf15b08imof/AADc-XJJjmrp6ZKZGqD68Mola?dl=0


As you can see from those screenshots there are 2 core processes wich are looping and put cpu at highest usage:


1.99 s 62.4% 0 s __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__

1.19 s 37.3% 0 s __CFRunLoopDoTimers


I don't know why this happens in iOS 11, on iOS 10.3.3 there wasn't this issue, the only differences on the main swift file are some @objc tags and the new swift 4 compiler.


Let me know if you need more informations, Cheers!

Have you tried on latest beta.

Hi Anils, thanks for you reply.


Yes I've tried but the problem persist.


Cheers.

Ok so I've partially solved this issue (wich is still present on iOS 11.1 beta 2 XCode 9.1 beta 2).


The problem was related to the UITextView, for some reason when you assign something wich is nil or empty or is not a String value to the UITextView.text property after scrolling the Table the iOS system start an infinite loop.


I think this problem is related to the dequeReusableCell function, I've solved the issue just adding a check like this:


if(myTextView.text != ""){
     myViewContainer.addSubView(myTextView);
}


This isn't a good solution to this bug, but now my tableview doesn't crash my entire application.
I swear than the future iOS releases will solve this issue.

UITableView Scroll issue with 100% cpu usage static
 
 
Q