Re: iPhone: NSOperation and UITableVIews
Re: iPhone: NSOperation and UITableVIews
- Subject: Re: iPhone: NSOperation and UITableVIews
- From: Alex Kac <email@hidden>
- Date: Mon, 9 Nov 2009 14:23:03 -0600
One good reason not to cancel is if a user is going to go up/down the
list then going ahead and storing the image you got (caching) is a
better deal. That way you aren't continuously reloading that image or
canceling or what not. Finally if you use an NSOperation, try to let
it work in sequence or at most 2-3 concurrent operations.
On Nov 9, 2009, at 2:13 PM, John Michael Zorko wrote:
Dave, Alex ...
An alternative implementation might be to have each cell queue up
an operation when it needs to load an image (not the view
controller). Then, each cell could cancel it's operation in
[UITableViewCell prepareForReuse].
Cool -- I learned something today :-) I did this, so now the
NSOperation * is stored in the cell, hence I can get it from
prepareToReuse and call cancel on it. Nifty! I also set the tag of
the cell and get it back in my refresh method, which means i'm only
telling the cells currently displayed to load their artwork. The
scrolling is still a bit jerky, though much much better, and nothing
i've not seen in other apps on this device (first gen 8G iPod touch,
running OS 2.2.1). I'm sure it will perform much better on a more
recent device like my iPhone 3GS, but I like to test with the oldest
thing I can :-)
Regards,
John
Falling You - exploring the beauty of voice and sound
http://www.fallingyou.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Alex Kac - President and Founder
Web Information Solutions, Inc.
"Forgiveness is not an occasional act: it is a permanent attitude."
-- Dr. Martin Luther King
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden