<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: UITables with Downloaded Images &#8211; Easy Asynchronous Code</title>
	<atom:link href="http://www.markj.net/iphone-asynchronous-table-image/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markj.net/iphone-asynchronous-table-image/</link>
	<description>iPhone App Development &#38; Consulting</description>
	<lastBuildDate>Sun, 07 Mar 2010 04:11:13 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daily Review #49 &#124; The Queue Blog</title>
		<link>http://www.markj.net/iphone-asynchronous-table-image/comment-page-2/#comment-2172</link>
		<dc:creator>Daily Review #49 &#124; The Queue Blog</dc:creator>
		<pubDate>Sun, 07 Mar 2010 04:11:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=174#comment-2172</guid>
		<description>[...] UITables with Downloaded Images &#8211; if you want to load images on a background thread, you should read this. I have an iphone app coming up and I might give Titanium a hard look. [...]</description>
		<content:encoded><![CDATA[<p>[...] UITables with Downloaded Images &#8211; if you want to load images on a background thread, you should read this. I have an iphone app coming up and I might give Titanium a hard look. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iPhone uygulamaları geliştirmek isteyenler için ücretsiz 100 kurs ve rehber &#171; Kerem PALABIYIK</title>
		<link>http://www.markj.net/iphone-asynchronous-table-image/comment-page-2/#comment-2165</link>
		<dc:creator>iPhone uygulamaları geliştirmek isteyenler için ücretsiz 100 kurs ve rehber &#171; Kerem PALABIYIK</dc:creator>
		<pubDate>Sat, 27 Feb 2010 20:49:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=174#comment-2165</guid>
		<description>[...] iPhone Asynchonous Table Image: Follow this thorough article to learn about loading multiple images in your iPhone app in an asynchonous manner. [Markj] [...]</description>
		<content:encoded><![CDATA[<p>[...] iPhone Asynchonous Table Image: Follow this thorough article to learn about loading multiple images in your iPhone app in an asynchonous manner. [Markj] [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: radha</title>
		<link>http://www.markj.net/iphone-asynchronous-table-image/comment-page-2/#comment-2164</link>
		<dc:creator>radha</dc:creator>
		<pubDate>Sat, 27 Feb 2010 11:17:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=174#comment-2164</guid>
		<description>Hi !
I have been trying to sort the cells in my UITable view in alphabetical order.
can anybody help me.

thanx in advance.</description>
		<content:encoded><![CDATA[<p>Hi !<br />
I have been trying to sort the cells in my UITable view in alphabetical order.<br />
can anybody help me.</p>
<p>thanx in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sabes</title>
		<link>http://www.markj.net/iphone-asynchronous-table-image/comment-page-2/#comment-2155</link>
		<dc:creator>sabes</dc:creator>
		<pubDate>Wed, 17 Feb 2010 20:44:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=174#comment-2155</guid>
		<description>Is anyone having crashes of the code with iPhone SDK 3.2 Beta?</description>
		<content:encoded><![CDATA[<p>Is anyone having crashes of the code with iPhone SDK 3.2 Beta?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wolf</title>
		<link>http://www.markj.net/iphone-asynchronous-table-image/comment-page-2/#comment-2149</link>
		<dc:creator>Wolf</dc:creator>
		<pubDate>Wed, 10 Feb 2010 23:46:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=174#comment-2149</guid>
		<description>Hi there.

Now this is truly a good piece of code. ANYWAY, HERE IS A TRICKY ONE: Can anyone figure out how to get device orientation change to work? If I setup something like that :

CGRect frame;
frame.size.width=320; frame.size.height=480;
frame.origin.x=0; frame.origin.y=0;
AsyncImageView* asyncImage = [[[AsyncImageView alloc] initWithFrame:frame] autorelease]; 

and I am in portrait mode an image which is larger than 320x480 will be autoresizedtofit. good so far. but then when I turn the device into landscape mode the image stays in size (does not resize itself to autowidth) and it sits at the very left. its like the whole frame with its 320x480 is rotated and does not resize itself to the landscape mode.

Anybody a solution to that?</description>
		<content:encoded><![CDATA[<p>Hi there.</p>
<p>Now this is truly a good piece of code. ANYWAY, HERE IS A TRICKY ONE: Can anyone figure out how to get device orientation change to work? If I setup something like that :</p>
<p>CGRect frame;<br />
frame.size.width=320; frame.size.height=480;<br />
frame.origin.x=0; frame.origin.y=0;<br />
AsyncImageView* asyncImage = [[[AsyncImageView alloc] initWithFrame:frame] autorelease]; </p>
<p>and I am in portrait mode an image which is larger than 320&#215;480 will be autoresizedtofit. good so far. but then when I turn the device into landscape mode the image stays in size (does not resize itself to autowidth) and it sits at the very left. its like the whole frame with its 320&#215;480 is rotated and does not resize itself to the landscape mode.</p>
<p>Anybody a solution to that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kan</title>
		<link>http://www.markj.net/iphone-asynchronous-table-image/comment-page-2/#comment-2146</link>
		<dc:creator>kan</dc:creator>
		<pubDate>Sun, 07 Feb 2010 12:46:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=174#comment-2146</guid>
		<description>hi, 
i try to test on the loadImageFromURL, and don&#039;t know how to get the image which should be return.

should you write out the usage of it in detail ?

Thank you for your help

Kan</description>
		<content:encoded><![CDATA[<p>hi,<br />
i try to test on the loadImageFromURL, and don&#8217;t know how to get the image which should be return.</p>
<p>should you write out the usage of it in detail ?</p>
<p>Thank you for your help</p>
<p>Kan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert A.</title>
		<link>http://www.markj.net/iphone-asynchronous-table-image/comment-page-2/#comment-2145</link>
		<dc:creator>Robert A.</dc:creator>
		<pubDate>Fri, 05 Feb 2010 17:28:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=174#comment-2145</guid>
		<description>Great Post. Thanks to everyone that contributed. I&#039;m trying out the YellowJacket code and added what I hope is an improvement that solves the caching issue that a few users mentioned with earlier images showing up before new ones are loaded.

In AsyncImageView.m, line 71, I&#039;ve provided an alternative image if a cached image does not exist for the current cell. 

//------------existing code---------------

if (imageCache == nil) // lazily create image cache
        imageCache = [[ImageCache alloc] initWithMaxSize:2*1024*1024];  // 2 MB Image cache
    
    [urlString release];
    urlString = [[url absoluteString] copy];
    UIImage *cachedImage = [imageCache imageForKey:urlString];
    if (cachedImage != nil) {
        if ([[self subviews] count] &gt; 0) {
            [[[self subviews] objectAtIndex:0] removeFromSuperview];
        }
        UIImageView *imageView = [[[UIImageView alloc] initWithImage:cachedImage] autorelease];
        imageView.contentMode = UIViewContentModeScaleAspectFit;
        imageView.autoresizingMask = 
            UIViewAutoresizingFlexibleWidth &#124; UIViewAutoresizingFlexibleHeight;
        [self addSubview:imageView];
        imageView.frame = self.bounds;
        [imageView setNeedsLayout]; // is this necessary if superview gets setNeedsLayout?
        [self setNeedsLayout];
        return;
//----------- Line 71 ------------

} else {
		// Use a default placeholder when no cached image is found
		UIImageView *imageView = [[[UIImageView alloc] initWithImage:[UIImage 						
		imageNamed:@&quot;placeholder.png&quot;]] autorelease];
		imageView.contentMode = UIViewContentModeScaleAspectFit;
		imageView.autoresizingMask = 
			UIViewAutoresizingFlexibleWidth &#124; UIViewAutoresizingFlexibleHeight;
		[self addSubview:imageView];
		imageView.frame = self.bounds;
		[imageView setNeedsLayout];
		[self setNeedsLayout];
	}
 
Be sure not to include a &quot;return;&quot; at the end of this else block or all your thumbs will be your default placeholder. You want the code to continue to run after you insert the placeholder.

Let me know if you find any problems!</description>
		<content:encoded><![CDATA[<p>Great Post. Thanks to everyone that contributed. I&#8217;m trying out the YellowJacket code and added what I hope is an improvement that solves the caching issue that a few users mentioned with earlier images showing up before new ones are loaded.</p>
<p>In AsyncImageView.m, line 71, I&#8217;ve provided an alternative image if a cached image does not exist for the current cell. </p>
<p>//&#8212;&#8212;&#8212;&#8212;existing code&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>if (imageCache == nil) // lazily create image cache<br />
        imageCache = [[ImageCache alloc] initWithMaxSize:2*1024*1024];  // 2 MB Image cache</p>
<p>    [urlString release];<br />
    urlString = [[url absoluteString] copy];<br />
    UIImage *cachedImage = [imageCache imageForKey:urlString];<br />
    if (cachedImage != nil) {<br />
        if ([[self subviews] count] &gt; 0) {<br />
            [[[self subviews] objectAtIndex:0] removeFromSuperview];<br />
        }<br />
        UIImageView *imageView = [[[UIImageView alloc] initWithImage:cachedImage] autorelease];<br />
        imageView.contentMode = UIViewContentModeScaleAspectFit;<br />
        imageView.autoresizingMask =<br />
            UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;<br />
        [self addSubview:imageView];<br />
        imageView.frame = self.bounds;<br />
        [imageView setNeedsLayout]; // is this necessary if superview gets setNeedsLayout?<br />
        [self setNeedsLayout];<br />
        return;<br />
//&#8212;&#8212;&#8212;&#8211; Line 71 &#8212;&#8212;&#8212;&#8212;</p>
<p>} else {<br />
		// Use a default placeholder when no cached image is found<br />
		UIImageView *imageView = [[[UIImageView alloc] initWithImage:[UIImage<br />
		imageNamed:@"placeholder.png"]] autorelease];<br />
		imageView.contentMode = UIViewContentModeScaleAspectFit;<br />
		imageView.autoresizingMask =<br />
			UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;<br />
		[self addSubview:imageView];<br />
		imageView.frame = self.bounds;<br />
		[imageView setNeedsLayout];<br />
		[self setNeedsLayout];<br />
	}</p>
<p>Be sure not to include a &#8220;return;&#8221; at the end of this else block or all your thumbs will be your default placeholder. You want the code to continue to run after you insert the placeholder.</p>
<p>Let me know if you find any problems!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://www.markj.net/iphone-asynchronous-table-image/comment-page-2/#comment-2112</link>
		<dc:creator>James</dc:creator>
		<pubDate>Mon, 18 Jan 2010 08:39:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=174#comment-2112</guid>
		<description>Ok people i finally found the way to empty the cache from the yellow jackets code. This code works for me. Hope it helps you out. 

Make sure to make the reference to these methods in the header files of the class specified. 

First you will need to add a method to the ImageCache Class to empty the NSDictionary in that class something like this. 

-(void)emptyCache{
	
	[myDictionary removeAllObjects];
	
	
	NSLog(@&quot;all objects removed Cache has been empty&quot;);
}

Second You will add an identical method in the AsyncImageView class.
like this 

-(void)emptyImages{
	
	[imageCache emptyCache]; // tells the image class to implement the empty cache method
}

And lastly in your TableViewController Class. in the dealloc method add this line of code between the brackets.

[asyncImage emptyImages];


I implement this when my table view gets deallocated although you might want to els ware 

I hope this helps the code has not been fully tested for leaks but if I am missing something feel free to modify.</description>
		<content:encoded><![CDATA[<p>Ok people i finally found the way to empty the cache from the yellow jackets code. This code works for me. Hope it helps you out. </p>
<p>Make sure to make the reference to these methods in the header files of the class specified. </p>
<p>First you will need to add a method to the ImageCache Class to empty the NSDictionary in that class something like this. </p>
<p>-(void)emptyCache{</p>
<p>	[myDictionary removeAllObjects];</p>
<p>	NSLog(@&#8221;all objects removed Cache has been empty&#8221;);<br />
}</p>
<p>Second You will add an identical method in the AsyncImageView class.<br />
like this </p>
<p>-(void)emptyImages{</p>
<p>	[imageCache emptyCache]; // tells the image class to implement the empty cache method<br />
}</p>
<p>And lastly in your TableViewController Class. in the dealloc method add this line of code between the brackets.</p>
<p>[asyncImage emptyImages];</p>
<p>I implement this when my table view gets deallocated although you might want to els ware </p>
<p>I hope this helps the code has not been fully tested for leaks but if I am missing something feel free to modify.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Gibbens</title>
		<link>http://www.markj.net/iphone-asynchronous-table-image/comment-page-2/#comment-2111</link>
		<dc:creator>Rob Gibbens</dc:creator>
		<pubDate>Mon, 18 Jan 2010 03:30:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=174#comment-2111</guid>
		<description>Excellent tutorial.  Thank you so much. I tried a bunch of different ways to get this to work before finding this site.  

I&#039;ve ported the code from Objective-C to MonoTouch (C#).  Would you mind if I blogged about it, giving full reference to this site of course?</description>
		<content:encoded><![CDATA[<p>Excellent tutorial.  Thank you so much. I tried a bunch of different ways to get this to work before finding this site.  </p>
<p>I&#8217;ve ported the code from Objective-C to MonoTouch (C#).  Would you mind if I blogged about it, giving full reference to this site of course?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://www.markj.net/iphone-asynchronous-table-image/comment-page-2/#comment-2103</link>
		<dc:creator>James</dc:creator>
		<pubDate>Sat, 16 Jan 2010 06:43:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=174#comment-2103</guid>
		<description>Hello There this has been a great resource for me I want to thank mark a lot. For the viewers that want to know where wayne&#039;s post is click on the link to older comments it is below the last comment on the page right before the word Trackbacks. I have implemented the yellowjacket code into my app.The problem is  my app loads a lot of images in like over 1,000.  Therefore allocating a lot of memory. 

My question is for those of you using the yellojacket code. I would like to know how to empty the cache of the image objects. Within my view did disappear method of the table view&#039;s delegate. Or in my app delegate&#039;s did receive memory warning method. 

The implementation of this would be greatly appreciated as I have slamming my head against the wall for about three days know trying to do this. I know it is something small that i&#039;m just not doing properly.  Thank you</description>
		<content:encoded><![CDATA[<p>Hello There this has been a great resource for me I want to thank mark a lot. For the viewers that want to know where wayne&#8217;s post is click on the link to older comments it is below the last comment on the page right before the word Trackbacks. I have implemented the yellowjacket code into my app.The problem is  my app loads a lot of images in like over 1,000.  Therefore allocating a lot of memory. </p>
<p>My question is for those of you using the yellojacket code. I would like to know how to empty the cache of the image objects. Within my view did disappear method of the table view&#8217;s delegate. Or in my app delegate&#8217;s did receive memory warning method. </p>
<p>The implementation of this would be greatly appreciated as I have slamming my head against the wall for about three days know trying to do this. I know it is something small that i&#8217;m just not doing properly.  Thank you</p>
]]></content:encoded>
	</item>
</channel>
</rss>
