<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>de &#187; uiimageview</title>
	<atom:link href="http://duivesteyn.net/tag/uiimageview/feed/" rel="self" type="application/rss+xml" />
	<link>http://duivesteyn.net</link>
	<description></description>
	<lastBuildDate>Tue, 20 Apr 2010 22:00:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>iPhone OS SDK &#8211; Tableview Text and Subtitle with Image using Indent</title>
		<link>http://duivesteyn.net/2010/04/06/iphone-os-sdk-tableview-text-and-subtitle-with-image-using-indent/</link>
		<comments>http://duivesteyn.net/2010/04/06/iphone-os-sdk-tableview-text-and-subtitle-with-image-using-indent/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 07:00:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[tableview]]></category>
		<category><![CDATA[uiimageview]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/04/01/iphone-os-sdk-tableview-text-and-subtitle-with-image-using-indent/</guid>
		<description><![CDATA[Today I am posting something small which adds a great touch to a UITableViewCell. I would like to show you how to add an image to the left of a tableview cell, in the minimum amount of code (realistically) possible. Firstly I am using the TableViewStyle UITableViewCellStyleSubtitle Which is great for a main row of [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 12pt;">Today I am posting something small which adds a great touch to a UITableViewCell. I would like to show you how to add an image to the left of a tableview cell, in the minimum amount of code (realistically) possible.</p>
<p>Firstly I am using the TableViewStyle </span><span style="color: rgb(46,13,110);">UITableViewCellStyleSubtitle </span><span style="font-size: 12pt;">Which is great for a main row of text and a smaller row of text underneath.</p>
<p><strong>UITableViewCellStyleSubtitle &#8211; Subtitle Row Style</strong></p>
<p>First the visual output:<br />
<img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-01at20.18.37.gA30siNRxbKg.jpg" alt="Screenshot2010-04-01at20.18.37.gA30siNRxbKg.jpg" width="287" height="268" /></p>
<p>and the code:</p>
<p></span>- (<span style="color: rgb(92,38,153);">UITableViewCell</span> *)tableView:(<span style="color: rgb(92,38,153);">UITableView</span> *)<span style="color: rgb(92,38,153);">tableView</span> cellForRowAtIndexPath:(<span style="color: rgb(92,38,153);">NSIndexPath</span> *)indexPath {</p>
<p>    <span style="color: rgb(170,13,145);">static</span> <span style="color: rgb(92,38,153);">NSString</span> *CellIdentifier = <span style="color: rgb(196,26,22);">@&#8221;CellIdentifier&#8221;</span>;</p>
<p>    <span style="color: rgb(0,116,0);">// Dequeue or create a cell of the appropriate type.</span><br />
    <span style="color: rgb(92,38,153);">UITableViewCell</span> *cell = [<span style="color: rgb(92,38,153);">tableView</span> <span style="color: rgb(46,13,110);">dequeueReusableCellWithIdentifier</span>:CellIdentifier];<br />
    <span style="color: rgb(170,13,145);">if</span> (cell == <span style="color: rgb(170,13,145);">nil</span>) {<br />
        cell = [[[<span style="color: rgb(92,38,153);">UITableViewCell</span> <span style="color: rgb(46,13,110);">alloc</span>] <span style="color: rgb(46,13,110);">initWithStyle</span>:<span style="color: rgb(46,13,110);">UITableViewCellStyleSubtitle</span> <span style="color: rgb(46,13,110);">reuseIdentifier</span>:CellIdentifier] <span style="color: rgb(46,13,110);">autorelease</span>];</p>
<p>}</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;cell.<span style="color: rgb(92,38,153);">detailTextLabel</span>.<span style="color: rgb(92,38,153);">text</span> = tempName;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;cell.<span style="color: rgb(92,38,153);">textLabel</span>.<span style="color: rgb(92,38,153);">text</span> = tempProject;</p>
<p>}</p>
<p><span style="font-size: 12pt;">But I would like to add an image to the left side. In the past I have Created three custom views ontop of each cell, and then for each cell, set a number of properties and inserted the text/image. This was all created and deallocated automatically. </p>
<p>I have found an even simpler way to do all of this. It uses the fantastic property ‘</span><span style="color: rgb(92,38,153);">indentationWidth</span><span style="font-size: 12pt;">’</p>
<p><strong>UITableViewCellStyleSubtitle &#8211; Subtitle Row Style with Image</p>
<p></strong>First the output pic:</p>
<p><img src="http://duivesteyn.net/wp-content/uploads/2010/04/ss2.tCfIZR4wjSgz.jpg" alt="ss2.tCfIZR4wjSgz.jpg" width="320" height="334" /></p>
<p>And the code:</p>
<p></span>- (<span style="color: rgb(92,38,153);">UITableViewCell</span> *)tableView:(<span style="color: rgb(92,38,153);">UITableView</span> *)<span style="color: rgb(92,38,153);">tableView</span> cellForRowAtIndexPath:(<span style="color: rgb(92,38,153);">NSIndexPath</span> *)indexPath {</p>
<p>    <span style="color: rgb(170,13,145);">static</span> <span style="color: rgb(92,38,153);">NSString</span> *CellIdentifier = <span style="color: rgb(196,26,22);">@&#8221;CellIdentifier&#8221;</span>;</p>
<p>    <span style="color: rgb(0,116,0);">// Dequeue or create a cell of the appropriate type.</span><br />
    <span style="color: rgb(92,38,153);">UITableViewCell</span> *cell = [<span style="color: rgb(92,38,153);">tableView</span> <span style="color: rgb(46,13,110);">dequeueReusableCellWithIdentifier</span>:CellIdentifier];<br />
    <span style="color: rgb(170,13,145);">if</span> (cell == <span style="color: rgb(170,13,145);">nil</span>) {<br />
        cell = [[[<span style="color: rgb(92,38,153);">UITableViewCell</span> <span style="color: rgb(46,13,110);">alloc</span>] <span style="color: rgb(46,13,110);">initWithStyle</span>:<span style="color: rgb(46,13,110);">UITableViewCellStyleSubtitle</span> <span style="color: rgb(46,13,110);">reuseIdentifier</span>:CellIdentifier] <span style="color: rgb(46,13,110);">autorelease</span>];<br />
        cell.<span style="color: rgb(92,38,153);">accessoryType</span> = <span style="color: rgb(46,13,110);">UITableViewCellAccessoryDisclosureIndicator</span>;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;cell.<span style="color: rgb(92,38,153);">selectionStyle</span> = <span style="color: rgb(46,13,110);">UITableViewCellSelectionStyleBlue</span>;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(0,116,0);">//Indentation Code.</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;cell.<span style="color: rgb(92,38,153);">indentationLevel</span> = <span style="color: rgb(28,0,207);">1</span>;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;cell.<span style="color: rgb(92,38,153);">indentationWidth</span> = 30;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(92,38,153);">CGRect</span> frame; frame.<span style="color: rgb(92,38,153);">origin</span>.<span style="color: rgb(92,38,153);">x</span> = <span style="color: rgb(28,0,207);">5</span>; frame.<span style="color: rgb(92,38,153);">origin</span>.<span style="color: rgb(92,38,153);">y</span> = <span style="color: rgb(28,0,207);">5</span>; frame.<span style="color: rgb(92,38,153);">size</span>.<span style="color: rgb(92,38,153);">height</span> = <span style="color: rgb(28,0,207);">32</span>; frame.<span style="color: rgb(92,38,153);">size</span>.<span style="color: rgb(92,38,153);">width</span> = <span style="color: rgb(28,0,207);">32</span>;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(0,116,0);">//Print Icon</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(92,38,153);">UIImageView</span> *imgLabel = [[<span style="color: rgb(92,38,153);">UIImageView</span> <span style="color: rgb(46,13,110);">alloc</span>] <span style="color: rgb(46,13,110);">initWithFrame</span>:frame];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;imgLabel.<span style="color: rgb(92,38,153);">tag</span> = <span style="color: rgb(28,0,207);">1000</span>;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[cell.<span style="color: rgb(92,38,153);">contentView</span> <span style="color: rgb(46,13,110);">addSubview</span>:imgLabel];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[imgLabel <span style="color: rgb(46,13,110);">release</span>];&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</p>
<p>    }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;cell.<span style="color: rgb(92,38,153);">detailTextLabel</span>.<span style="color: rgb(92,38,153);">text</span> = tempName;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;cell.<span style="color: rgb(92,38,153);">textLabel</span>.<span style="color: rgb(92,38,153);">text</span> = tempProject;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(0,116,0);">//Setup Pic in Cell</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(92,38,153);">UIImageView</span> *imageView = (<span style="color: rgb(92,38,153);">UIImageView</span> *) [cell.<span style="color: rgb(92,38,153);">contentView</span> <span style="color: rgb(46,13,110);">viewWithTag</span>:<span style="color: rgb(28,0,207);">1000</span>];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;imageView.<span style="color: rgb(92,38,153);">image</span> = [<span style="color: rgb(92,38,153);">UIImage</span> <span style="color: rgb(46,13,110);">imageNamed</span>:<span style="color: rgb(196,26,22);">@"ico-project.png"</span>]; <span style="color: rgb(0,116,0);">// set the image for the imageview</p>
<p></span>}</p>
<p><span style="font-size: 12pt;">This is a vast improvement to what I have previously used and have seen online.</p>
<p>I Hope this is found to be useful!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/04/06/iphone-os-sdk-tableview-text-and-subtitle-with-image-using-indent/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPhone SDK FirstRun.png &#8211; Displaying Special &#8216;one off&#8217; info in an app</title>
		<link>http://duivesteyn.net/2010/02/19/iphone-sdk-firstrun-png-displaying-special-one-off-info-in-an-app/</link>
		<comments>http://duivesteyn.net/2010/02/19/iphone-sdk-firstrun-png-displaying-special-one-off-info-in-an-app/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 07:01:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[firstrun]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[microcrm-behindthescences]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[uiimageview]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/?p=196</guid>
		<description><![CDATA[In making MicroCRM, I wanted to display some temp information to the user when a table list was empty. I wanted to make it as clear as possible a &#8216;lead&#8217;, &#8216;job&#8217; or &#8216;invoice&#8217; needs to be added first. This is not a new concept in iPhone/Mac apps, but I want to share my implementation. 1. [...]]]></description>
			<content:encoded><![CDATA[<p>In making <a href="http://microcrmapp.com" target="_blank">MicroCRM</a>, I wanted to display some temp information to the user when a table list was empty. I wanted to make it as clear as possible a &#8216;lead&#8217;, &#8216;job&#8217; or &#8216;invoice&#8217; needs to be added first.</p>
<p>This is not a new concept in iPhone/Mac apps, but I want to share my implementation.</p>
<p>1. Firstly, I made the picture I wanted to display in my app.  Then it was added to my Xcode project. Below is the actual artwork the app uses.</p>
<p style="text-align: center;"><a href="http://duivesteyn.net/wp-content/uploads/2010/02/img-FirstRun1.png" rel="lightbox[196]"><img class="alignnone size-full wp-image-199" title="img-FirstRun1" src="http://duivesteyn.net/wp-content/uploads/2010/02/img-FirstRun1.png" alt="" width="320" height="100" /></a></p>
<p><a href="http://duivesteyn.net/wp-content/uploads/2010/02/img-FirstRun1.png" rel="lightbox[196]"></a>2. The following code is placed in  (void)viewWillAppear: for the ViewController I wanted to place the image. (I have commented it well to help the reader).</p>
<p><code>//de.009 - FirstRun Image if ArrayCount is 0</code></p>
<p><code> </code></p>
<p><code>[firstRunImage removeFromSuperview];</code></p>
<p><code>int InvoiceCount = [appDelegate.Array count];    //get number of Invoices&lt;br /&gt;<br />
 NSString *arraycount = [NSString stringWithFormat:@"%d", InvoiceCount];&lt;br /&gt;<br />
 NSLog (@"Leads Page Loaded: %@ Entries",arraycount);    //Log code for number of items in array</code></p>
<p><code> </code></p>
<p><br class="spacer_" /></p>
<p><code>if (InvoiceCount==0) {       //If there are no invoices&lt;br /&gt;<br />
 NSLog (@"Adding First Run Image");     //Log code&lt;br /&gt;<br />
 firstRunImage=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"img-FirstRun.png"]];     //Allocate UIImageView to hold the image, and define the image&lt;br /&gt;<br />
 firstRunImage.frame = CGRectMake(0,0,320,100);      //Define Frame Size&lt;br /&gt;<br />
 [self.view addSubview:firstRunImage];    //Add ImageView to current view&lt;br /&gt;<br />
 } else {&lt;br /&gt;<br />
 [firstRunImage removeFromSuperview];    //Otherwise remove it&lt;br /&gt;<br />
 [firstRunImage release], firstRunImage=nil;  //release memory&lt;br /&gt;<br />
 }</code></p>
<p><strong>See it in action</strong></p>
<p style="text-align: center;"><strong><a href="http://duivesteyn.net/wp-content/uploads/2010/02/FirstRun-no-entry.png" rel="lightbox[196]"><img class="alignnone size-medium wp-image-197" title="FirstRun-no-entry" src="http://duivesteyn.net/wp-content/uploads/2010/02/FirstRun-no-entry-161x300.png" alt="" width="161" height="300" /></a><a href="http://duivesteyn.net/wp-content/uploads/2010/02/FirstRun-TableFilled.png" rel="lightbox[196]"><img title="FirstRun-TableFilled" src="http://duivesteyn.net/wp-content/uploads/2010/02/FirstRun-TableFilled-161x300.png" alt="" width="161" height="300" /></a></strong></p>
<p>And thats it. I have the same code for all three sections of my app. To get the app, goto <a href="http://microcrmapp.com" target="_blank">http://microcrmapp.com</a> and follow the app store link.</p>
<p>Other implementations of a similar idea are found in many different apps. Apple&#8217;s own included apps, the facebook app and so on. There is a particularly common UI element that seems to be an imitation of apple&#8217;s own included &#8216;no data/history/updating&#8217; page (see below). This is becoming more and more common place and it does seem to be a nice way to show the user &#8216;theres nothing!&#8217;.</p>
<p style="text-align: center;"><a href="http://duivesteyn.net/wp-content/uploads/2010/02/IMG_0597.png" rel="lightbox[196]"><img class="alignnone size-full wp-image-470" title="iPhone UI - No History in Pennies" src="http://duivesteyn.net/wp-content/uploads/2010/02/IMG_0597.png" alt="" width="320" height="480" /></a><a href="http://duivesteyn.net/wp-content/uploads/2010/02/IMG_0573.png" rel="lightbox[196]"><img class="alignnone size-full wp-image-472" title="Tea Round FirstRun" src="http://duivesteyn.net/wp-content/uploads/2010/02/IMG_0573.png" alt="" width="320" height="480" /></a></p>
<p>I have even found a way to implement this, its using the amazing <a href="http://github.com/devinross/tapkulibrary">TapkuLibrary</a>. I&#8217;ll let you work it all out for yourself now and it may even become a new post in the future</p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/02/19/iphone-sdk-firstrun-png-displaying-special-one-off-info-in-an-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhoneOS iPhone iPad Development (quick) Displaying an Image in UIImageView</title>
		<link>http://duivesteyn.net/2010/02/10/iphoneos-iphone-ipad-development-quick-displaying-an-image-in-uiimageview/</link>
		<comments>http://duivesteyn.net/2010/02/10/iphoneos-iphone-ipad-development-quick-displaying-an-image-in-uiimageview/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 09:00:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[Codename:VioletBrown]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[uiimageview]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/?p=355</guid>
		<description><![CDATA[A quick iPhoneOS Development tip today, loading an image resource into a UIImageView field. I had created a UIImageView in Interface Builder, but I wanted the image to change every time the page appears. In interface builder I have linked a UIImageView to the IBOutlet recipeImage I use the following code to load up a new [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-356" title="iPhone iPad UIImageView" src="http://duivesteyn.net/wp-content/uploads/2010/02/iPhone-iPad-UIImageView.png" alt="" width="230" height="197" /></p>
<p>A quick iPhoneOS Development tip today, loading an image resource into a UIImageView field.</p>
<p>I had created a UIImageView in Interface Builder, but I wanted the image to change every time the page appears.</p>
<p>In interface builder I have linked a UIImageView to the IBOutlet <em>recipeImage</em></p>
<p>I use the following code to load up a new image:</p>
<p><code>//Load Image  &lt;br /&gt;<br />
 NSString *recipeImageFileName = [temperatureDictionary objectForKey:@"Image"];   //Get Image Name as String (no extension) &lt;br /&gt;<br />
 UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:recipeImageFileName ofType:@"jpg"]]; //load the image into memory, adapt the parameters (filename, extension) as per needs &lt;br /&gt;<br />
 [recipeImage setImage:img];  //show the image in the UIImageView</code></p>
<p><br class="spacer_" /></p>
<p>Super simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/02/10/iphoneos-iphone-ipad-development-quick-displaying-an-image-in-uiimageview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
