Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ChristianVirtual

macrumors 601
Original poster
May 10, 2010
4,122
282
日本
I have right now a small problem with a UITextView in combination with a storyboard-driven UICollection Container; hoping someone has a good hint for me.

From the UICollectionContainer I have several cells which should contain each a text field with logging information.

When I update the UITextField with something like this
Code:
cell.unitLogText.text = unit.unitLog;
it technically work but has the awful user experience of scrolling to the top of the text.

a bit more enhanced version don't make it better ...
Code:
     if ([unit.unitLog length] > 0)
      {
         cell.unitLogText.scrollEnabled = NO;
         cell.unitLogText.text = unit.unitLog;

         NSRange range = NSMakeRange(unit.unitLog.length - 1, 1);
         [cell.unitLogText scrollRangeToVisible:range];

         cell.unitLogText.scrollEnabled = YES;
      }

it still flicker and don't provide me the smooth scrolling experience I would like to have similar to the debug/console in XCode.

What's wrong with my approach ? :(

Another idea might be to split the logfile into several lines and make a UITable out of it; but thats quite an effort I would like to avoid. Plus not sure if nested UITables in a UICollection is a good idea :confused:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.