UA-17470720-3

Jump to content


Photo
- - - - -

Caching of nib files


  • Please log in to reply
9 replies to this topic

#1 Lee Armstrong

Lee Armstrong

    Jr. Member

  • STV 3.0 Pro
  • PipPip
  • 18 posts
Reputation: 0
Neutral

Posted 26 April 2011 - 04:08 AM

Does Sensible Table View implement caching of the custom nib files at all just like

http://useyourloaf.com/blog/2011/2/28/speeding-up-table-view-cell-loading-with-uinib.html

EDIT -
I have just read that you do implement caching although doing some debugging for a VERY large tableView I don't think that I am getting the caching!

Here is my method...

- (SCControlCell *)tableViewModel:(SCTableViewModel *)tableViewModel
	  customCellForRowAtIndexPath:(NSIndexPath *)indexPath
{
	//NSLog(@"Called");
	NSDictionary *contactDataBindings = [NSDictionary 
										 dictionaryWithObjects:[NSArray arrayWithObjects:@"flightno", @"route",@"timeStamp", nil] 
										 forKeys:[NSArray arrayWithObjects:@"1", @"2",@"3", nil]];
	SCControlCell *contactOverviewCell = [SCControlCell cellWithText:nil withBoundObject:nil withObjectBindings:contactDataBindings
														 withNibName:@"FlightCell"];
	
	return contactOverviewCell;
}


#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 26 April 2011 - 09:52 AM

Hi Lee,

Please refer to the following post: http://www.sensiblec...ading.html#2075

Please tell me if you need any further help with this.

#3 Lee Armstrong

Lee Armstrong

    Jr. Member

  • STV 3.0 Pro
  • PipPip
  • 18 posts
Reputation: 0
Neutral

Posted 26 April 2011 - 09:56 AM

Thanks Tarek,

I might need a little help actually. I don't get how I can use a cached obejct with the

[SCControlCell cellWithText:nil withBoundObject:nil withObjectBindings:contactDataBindings
withNibName:@"FlightCell"];

line...

#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 26 April 2011 - 09:59 AM

In the above code, STV automatically does the caching for you. Are you having any performance issues? If yes, then I think you should wait for STV 2.0.4 before deciding that these issues relate to NIB caching.

#5 Lee Armstrong

Lee Armstrong

    Jr. Member

  • STV 3.0 Pro
  • PipPip
  • 18 posts
Reputation: 0
Neutral

Posted 26 April 2011 - 10:03 AM

Thanks Tarek,

Yes performance issues are being seen. I may give 2.0.4 a try at least then as per our other forum post.

Can you send over to me lee [at] pinkfroot.com

#6 Lee Armstrong

Lee Armstrong

    Jr. Member

  • STV 3.0 Pro
  • PipPip
  • 18 posts
Reputation: 0
Neutral

Posted 26 April 2011 - 05:16 PM

Tarek,

Thanks for the 2.0.4, it has sped things up a little. I still see a delay although not sure the code is correct as I need to call reloadData which is where I think it goes slow!

I have mailed you an example project

#7 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 26 April 2011 - 11:03 PM

Hey Lee,

Thank you very much for the sample project, got that! :) At first glance your code seems to be fine. I'll do some profiling and get back to you. Thanks again!

#8 Lee Armstrong

Lee Armstrong

    Jr. Member

  • STV 3.0 Pro
  • PipPip
  • 18 posts
Reputation: 0
Neutral

Posted 27 April 2011 - 04:33 AM

Perfect thanks Tarek. The delay does seem to be quite great.

PS - remember to test on the device as the mac has no trouble crunching that lot on a nice laptop CPU :-)

#9 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 03 May 2011 - 09:23 PM

Hi Lee,

Thanks again for providing us with the test app, it has been indispensable to us during our testing.

It turns out that we do need to further optimize our nib caching if all the cells come out of the same nib file. We'll be adding a new delegate method to STV 2.0.5 (due in just a couple of days) that you should use instead of customCellForRowAtIndexPath for a much better performance if you only have one cell type.

Please tell me if I can be of any more help. Thanks again!!

#10 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 04 May 2011 - 01:23 PM

Hi again Lee,

Update: After carefully re-thinking this, we decided against creating a new delegate method, and opted instead to do the caching transparently using the same existing customCellForRowAtIndexPath. This should make it much easier for our users and will save them a lot of confusion.

I'll send you now a pre-release version of STV 2.0.5 which implements this caching mechanism. All you need to do is replace the old STV files with the new ones and do a clean build. Thank you so much for all your feedback! :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users