UA-17470720-3

Jump to content


Photo
- - - - -

Improving performance


  • Please log in to reply
3 replies to this topic

#1 Aris Kox

Aris Kox

    Sr. Member

  • STV 5.0 Pro
  • PipPipPip
  • 35 posts
Reputation: 14
Good

Posted 06 August 2012 - 09:06 AM

Hello there,

It would be nice if we could improve Sensible's tableviews performance by disabling uitableview's delegate method tableView:heightForRowAtIndexPath: on demand.

Please notice that Apple's documentation specifies that implementing tableView:heightForRowAtIndexPath: has serious performance implications.


Ex you could add a property (ex PERFORMANCE_FLAG) on SCTableViewModel and implement the following function

- (BOOL)respondsToSelector:(SEL)aSelector
{
if (self.PERFORMANCE_FLAG && [NSStringFromSelector(aSelector) isEqualToString:@"tableView:heightForRowAtIndexPath:"])
return NO;

return [super respondsToSelector:aSelector];
}

The downside, is that when this flag is enabled, all the cells in the table will have the same height.

Thanks,
Aris

#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 10 August 2012 - 03:52 AM

Hi Aris,

SCArrayOfItemsSection actually has a property called 'enableCellAutoResizing' which is TRUE by default. Setting this property to FALSE disables automatic resizing of cells. Please tell me if you need anything else.

Thanks!

#3 Aris Kox

Aris Kox

    Sr. Member

  • STV 5.0 Pro
  • PipPipPip
  • 35 posts
Reputation: 14
Good

Posted 10 August 2012 - 03:58 AM

Hi Tarek,

That's good to know, but it won't improve the performance ;-)

If you have a table with ex 2000 rows then it's good to have what I'm proposing.

Thanks,
Aris

#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 11 August 2012 - 06:47 PM

Hi Aris,

The 'enableCellAutoResizing' option was actually developed to improve performance for a customer who had about 5000 cells in his application. Please tell me if you're having any performance issues and we can consider restudying all this once more.

Thanks for all the feedback!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users