<?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: Add Background Image To UIView</title>
	<atom:link href="http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/</link>
	<description>My blog to talk on iPhone, Mac OS, Adobe Flex, AIR...</description>
	<lastBuildDate>Thu, 12 Aug 2010 07:48:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Me</title>
		<link>http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/comment-page-1/#comment-672</link>
		<dc:creator>Me</dc:creator>
		<pubDate>Sun, 11 Apr 2010 07:21:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.macoscoders.com/?p=262#comment-672</guid>
		<description>How about:

self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@&quot;background.png&quot;]];</description>
		<content:encoded><![CDATA[<p>How about:</p>
<p>self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: memory leak</title>
		<link>http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/comment-page-1/#comment-604</link>
		<dc:creator>memory leak</dc:creator>
		<pubDate>Fri, 22 Jan 2010 14:08:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.macoscoders.com/?p=262#comment-604</guid>
		<description>You have a memory leak there. The correct code is:

UIColor *bkgColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@&quot;MyBackground.png&quot;]];
self.view.backgroundColor = bkgColor;
[bkgColor release];</description>
		<content:encoded><![CDATA[<p>You have a memory leak there. The correct code is:</p>
<p>UIColor *bkgColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"MyBackground.png"]];<br />
self.view.backgroundColor = bkgColor;<br />
[bkgColor release];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhijeet</title>
		<link>http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/comment-page-1/#comment-292</link>
		<dc:creator>Abhijeet</dc:creator>
		<pubDate>Fri, 07 Aug 2009 08:42:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.macoscoders.com/?p=262#comment-292</guid>
		<description>Both the code are same. In first one you are allocating color to background  and and assigning it an image.

In second one again the same thing is happening. The only difference is some extra code. This will increase the allocations of objects when viewed in instruments. 
there is no need to to first have a UIview as a separate object then assign it to the main view.

Simply extra piece of code.

Thanks.</description>
		<content:encoded><![CDATA[<p>Both the code are same. In first one you are allocating color to background  and and assigning it an image.</p>
<p>In second one again the same thing is happening. The only difference is some extra code. This will increase the allocations of objects when viewed in instruments.<br />
there is no need to to first have a UIview as a separate object then assign it to the main view.</p>
<p>Simply extra piece of code.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Agha</title>
		<link>http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/comment-page-1/#comment-174</link>
		<dc:creator>Agha</dc:creator>
		<pubDate>Tue, 14 Jul 2009 20:38:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.macoscoders.com/?p=262#comment-174</guid>
		<description>Thanks for tip.
The able code will fail.
Here is the correct code.
UIView *contentView = [[UIView alloc] initWithFrame: [[UIScreen mainScreen] applicationFrame]];
	//contentView.backgroundColor = [UIColor redColor];
	//contentView.backgroundColor = [UIColor viewFlipsideBackgroundColor];	
	//contentView.backgroundColor = [UIColor groupTableViewBackgroundColor];
	//contentView.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@&quot;someimage.png&quot;]];
	self.view = contentView;
	
    [contentView release];

Tnanks</description>
		<content:encoded><![CDATA[<p>Thanks for tip.<br />
The able code will fail.<br />
Here is the correct code.<br />
UIView *contentView = [[UIView alloc] initWithFrame: [[UIScreen mainScreen] applicationFrame]];<br />
	//contentView.backgroundColor = [UIColor redColor];<br />
	//contentView.backgroundColor = [UIColor viewFlipsideBackgroundColor];<br />
	//contentView.backgroundColor = [UIColor groupTableViewBackgroundColor];<br />
	//contentView.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"someimage.png"]];<br />
	self.view = contentView;</p>
<p>    [contentView release];</p>
<p>Tnanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
