<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>de</title>
	
	<link>http://duivesteyn.net</link>
	<description />
	<lastBuildDate>Tue, 20 Apr 2010 22:00:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/de-net" /><feedburner:info uri="de-net" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>iPhoneOS SDK – iPad Design Template – Multiple Views with Group Table View as the Master View Controller</title>
		<link>http://feedproxy.google.com/~r/de-net/~3/5nnAPM0tXfQ/</link>
		<comments>http://duivesteyn.net/2010/04/21/iphoneos-sdk-ipad-design-template-multiple-views-with-group-table-view-as-the-master-view-controller/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 22:00:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[Grouped]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[Splitview]]></category>
		<category><![CDATA[UITableView]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/04/15/iphoneos-sdk-ipad-design-template-multiple-views-with-group-table-view-as-the-master-view-controller/</guid>
		<description><![CDATA[Here’s my favorite iPad Project Template. Modified for 6 view controllers, split view, master tableview uses sections, and is in group format!

]]></description>
			<content:encoded><![CDATA[<p>Here’s my favorite iPad Project Template. Modified for 6 view controllers, split view, master tableview uses sections, and is in group format!</p>
<p><a href="http://duivesteyn.net/wp-content/uploads/2010/04/iPad-Empty-Project-1-6-View-Controllers-on-the-Left-working.zip"><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-14at18.03.13.kPF6RWxDwfm2.jpg" alt="Screenshot2010-04-14at18.03.13.kPF6RWxDwfm2.jpg" width="674" height="568" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/04/21/iphoneos-sdk-ipad-design-template-multiple-views-with-group-table-view-as-the-master-view-controller/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://duivesteyn.net/2010/04/21/iphoneos-sdk-ipad-design-template-multiple-views-with-group-table-view-as-the-master-view-controller/</feedburner:origLink></item>
		<item>
		<title>iPhoneOS SDK – Subclassing a UITableview</title>
		<link>http://feedproxy.google.com/~r/de-net/~3/xjpGWq1kDeA/</link>
		<comments>http://duivesteyn.net/2010/04/20/iphoneos-sdk-subclassing-a-uitableview/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 07:00:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/04/14/iphoneos-sdk-subclassing-a-uitableview/</guid>
		<description><![CDATA[This is more of a personal reminder about how to subclass a UITableViewCell, but this should be useful to the discerning reader. All the edits required to subclass are the lower code line in each section, the above is the default code (commented out).
.m file Modifications
#import &#8220;UITableViewCellFixed.h&#8221;
    // Below is first the [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: rgb(0,0,0);">This is more of a personal reminder about how to subclass a UITableViewCell, but this should be useful to the discerning reader. All the edits required to subclass are the lower code line in each section, the above is the default code (commented out).</span></p>
<p><span style="color: rgb(100,56,32);">.m file Modifications</p>
<p>#import </span><span style="color: rgb(196,26,22);">&#8220;UITableViewCellFixed.h&#8221;</span></p>
<p>    <span style="color: rgb(0,0,0);"></span><span style="color: rgb(0,116,0);">// Below is first the original then the subclassed</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(0,0,0);"></span><span style="color: rgb(0,116,0);">//UITableViewCell *cell = [tableview dequeueReusableCellWithIdentifier:CellIdentifier];</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(0,0,0);"></span><span style="color: rgb(63,110,116);">UITableViewCellFixed</span> <span style="color: rgb(0,0,0);">*cell = (</span><span style="color: rgb(63,110,116);">UITableViewCellFixed</span> <span style="color: rgb(0,0,0);">*)[tableView </span><span style="color: rgb(46,13,110);">dequeueReusableCellWithIdentifier</span><span style="color: rgb(0,0,0);">:CellIdentifier];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
    </span><span style="color: rgb(170,13,145);">if</span> <span style="color: rgb(0,0,0);">(cell == </span><span style="color: rgb(170,13,145);">nil</span><span style="color: rgb(0,0,0);">) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="color: rgb(0,116,0);">// Below is first the original then the subclassed</span><br />
      <span style="color: rgb(0,0,0);"></span><span style="color: rgb(0,116,0);">//cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease];</span><br />
        <span style="color: rgb(0,0,0);">cell = [[[</span><span style="color: rgb(63,110,116);">UITableViewCellFixed</span> <span style="color: rgb(0,0,0);"></span><span style="color: rgb(46,13,110);">alloc</span><span style="color: rgb(0,0,0);">] </span><span style="color: rgb(46,13,110);">initWithStyle</span><span style="color: rgb(0,0,0);">:</span><span style="color: rgb(46,13,110);">UITableViewCellStyleValue2</span> <span style="color: rgb(0,0,0);"></span><span style="color: rgb(46,13,110);">reuseIdentifier</span><span style="color: rgb(0,0,0);">:CellIdentifier] </span><span style="color: rgb(46,13,110);">autorelease</span><span style="color: rgb(0,0,0);">];<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><span style="color: rgb(0,116,0);">//Cell Accessories</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(0,0,0);"></span><span style="color: rgb(0,116,0);">//cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(0,0,0);">cell.</span><span style="color: rgb(92,38,153);">editingAccessoryType</span> <span style="color: rgb(0,0,0);">= </span><span style="color: rgb(46,13,110);">UITableViewCellAccessoryDisclosureIndicator</span><span style="color: rgb(0,0,0);">;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</p>
<p>    }</p>
<p>Then the subclass file looks like:</p>
<p></span><span style="color: rgb(0,116,0);">//  UITableViewCellFixed.h</span><br />
<span style="color: rgb(0,116,0);">//</span></p>
<p><span style="color: rgb(100,56,32);">#import </span><span style="color: rgb(196,26,22);">&lt;UIKit/UIKit.h&gt;</span></p>
<p><span style="color: rgb(170,13,145);">@interface</span> <span style="color: rgb(0,0,0);">UITableViewCellFixed : UITableViewCell {</p>
<p>}</p>
<p></span><span style="color: rgb(170,13,145);">@end</span></p>
<p><span style="color: rgb(0,116,0);">//</span><br />
<span style="color: rgb(0,116,0);">//  UITableViewCellFixed.m</span><br />
<span style="color: rgb(0,116,0);">//</span></p>
<p><span style="color: rgb(100,56,32);">#import </span><span style="color: rgb(196,26,22);">“UITableViewCellFixed.h”</span></p>
<p><span style="color: rgb(170,13,145);">@implementation</span> <span style="color: rgb(0,0,0);">UITableViewCellFixed<br />
- (</span><span style="color: rgb(170,13,145);">void</span><span style="color: rgb(0,0,0);">) layoutSubviews {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[</span><span style="color: rgb(170,13,145);">super</span> <span style="color: rgb(0,0,0);"></span><span style="color: rgb(46,13,110);">layoutSubviews</span><span style="color: rgb(0,0,0);">];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="color: rgb(170,13,145);">self</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">textLabel</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">frame</span> <span style="color: rgb(0,0,0);">= </span><span style="color: rgb(46,13,110);">CGRectMake</span><span style="color: rgb(0,0,0);">(</span><span style="color: rgb(170,13,145);">self</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">textLabel</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">frame</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">origin</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">x</span><span style="color: rgb(0,0,0);">,<br />
                                      </span><span style="color: rgb(28,0,207);">4.0</span><span style="color: rgb(0,0,0);">,<br />
                                      </span><span style="color: rgb(170,13,145);">self</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">textLabel</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">frame</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">size</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">width</span><span style="color: rgb(0,0,0);">,<br />
                                      </span><span style="color: rgb(170,13,145);">self</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">textLabel</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">frame</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">size</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">height</span><span style="color: rgb(0,0,0);">);<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="color: rgb(170,13,145);">self</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">detailTextLabel</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">frame</span> <span style="color: rgb(0,0,0);">= </span><span style="color: rgb(46,13,110);">CGRectMake</span><span style="color: rgb(0,0,0);">(</span><span style="color: rgb(170,13,145);">self</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">detailTextLabel</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">frame</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">origin</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">x</span><span style="color: rgb(0,0,0);">,<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="color: rgb(28,0,207);">8.0</span> <span style="color: rgb(0,0,0);">+ </span><span style="color: rgb(170,13,145);">self</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">textLabel</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">frame</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">size</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">height</span><span style="color: rgb(0,0,0);">,<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="color: rgb(170,13,145);">self</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">detailTextLabel</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">frame</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">size</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">width</span><span style="color: rgb(0,0,0);">,<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="color: rgb(170,13,145);">self</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">detailTextLabel</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">frame</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">size</span><span style="color: rgb(0,0,0);">.</span><span style="color: rgb(92,38,153);">height</span><span style="color: rgb(0,0,0);">);<br />
}<br />
</span><span style="color: rgb(170,13,145);">@end</span></p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/04/20/iphoneos-sdk-subclassing-a-uitableview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://duivesteyn.net/2010/04/20/iphoneos-sdk-subclassing-a-uitableview/</feedburner:origLink></item>
		<item>
		<title>iPhoneOS SDK – iPad Popover Controller</title>
		<link>http://feedproxy.google.com/~r/de-net/~3/d_wFpnRYay8/</link>
		<comments>http://duivesteyn.net/2010/04/19/iphone-sdk-ipad-popover-controller/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 07:00:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphoneOS]]></category>
		<category><![CDATA[popover]]></category>
		<category><![CDATA[popovercontroller]]></category>
		<category><![CDATA[sample-code]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/04/14/iphoneos-sdk-ipad-popover-controller-2/</guid>
		<description><![CDATA[
The iPad Popover control is possibly the least publicized feature of the iPhoneOS SDK, but becomes critical to in app actions and workflows. This is because the Popover Controller can show a small UIView of controls and more importantly save the user from having the whole screen change navigation hierarchy. A simple popover for example, [...]]]></description>
			<content:encoded><![CDATA[<p><br class="spacer_" /></p>
<p><span style="font-size: small;"><a href="http://duivesteyn.net/wp-content/uploads/2010/04/ipad-take-photo-sdk.jpg" rel="lightbox[646]"><img class="size-medium wp-image-651 alignright" title="ipad-take-photo-sdk" src="http://duivesteyn.net/wp-content/uploads/2010/04/ipad-take-photo-sdk-300x227.jpg" alt="" width="300" height="227" /></a><a href="http://duivesteyn.net/wp-content/uploads/2010/04/ipad-take-photo-sdk.jpg" rel="lightbox[646]"><span style="color: #000000; -webkit-text-decorations-in-effect: none;">The iPad Popover control is possibly the least publicized feature of the iPhoneOS SDK, but becomes critical to in app actions and workflows. This is because the Popover Controller can show a small UIView of controls and more importantly save the user from having the whole screen change navigation hierarchy. A simple popover for example, can be used to edit a textfield, or change a date really quickly. In an iPhone app, this would typically be done by sending the user to a &#8216;DetailView&#8217; where the setting/property can be change, whereas on the iPad this is highly discouraged.</span></a> I am going to go through a quick popover example today, and on monday I will post a fantastic iPad user template.</span></p>
<p><strong><span style="font-size: small;">1. Understanding the context</span></strong><span style="font-size: small;"><br />
 First, you need to know where a popover should be used. I can&#8217;t say much more than whats above. Use the apple apps, use the other top 100 apps, see how they use the popover controller. This will give you a feel of what it should do.<br />
 </span> <strong><span style="font-size: small;">2. Some Code</span></strong><span style="font-size: small;"><br />
 Firstly, your main view controller {.h} needs a &lt;UIPopoverControllerDelegate&gt; declaration.<br />
 In your main view controller, add the following to the @interface (.h file)</span></p>
<p><span style="font-size: small;"> </span><span style="font-size: small;"> </span><span style="color: #007400;"><span style="font-size: small;">//PopoverViewController</span></span><span style="font-size: small;"><br />
 </span><span style="font-size: small;"> </span><span style="color: #5c2699;"><span style="font-size: small;">UIPopoverController</span></span><span style="font-size: small;"> </span><span style="font-size: small;">*</span><span style="color: #3f6e74;"><span style="font-size: small;">popoverController</span></span><span style="font-size: small;">;</span></p>
<p><span style="font-size: small;">and just before @end add an IBAction:<br />
 </span> <span style="font-size: small;">- (</span><span style="color: #aa0d91;"><span style="font-size: small;">IBAction</span></span><span style="font-size: small;">)popOverViewCall:(</span><span style="color: #aa0d91;"><span style="font-size: small;">id</span></span><span style="font-size: small;">)sender;</span></p>
<p><span style="font-size: small;">Create a New View &amp; ViewController {.h/.m} files and place them in your project. This is the actual popover that will come up. Place controls how ever you see fit.  I call this popover controller MyViewControllerForPopover. Add an include of this file to your main view controller, eg:<br />
 </span> <span style="color: #643820;"><span style="font-size: small;">#import </span></span><span style="color: #c41a16;"><span style="font-size: small;">&#8220;FirstDetailViewControllerPopOverControl.h&#8221;</span></span></p>
<p><span style="font-size: small;">In MyViewControllerForPopop {.m file}, add the following code:<br />
 </span> <span style="font-size: small;">-(</span><span style="color: #aa0d91;"><span style="font-size: small;">void</span></span><span style="font-size: small;">)viewDidAppear:(</span><span style="color: #aa0d91;"><span style="font-size: small;">BOOL</span></span><span style="font-size: small;">)animated<br />
 {<br />
 </span><span style="color: #aa0d91;"><span style="font-size: small;">self</span></span><span style="font-size: small;">.</span><span style="color: #5c2699;"><span style="font-size: small;">contentSizeForViewInPopover</span></span><span style="font-size: small;"> </span><span style="font-size: small;">= </span><span style="color: #2e0d6e;"><span style="font-size: small;">CGSizeMake</span></span><span style="font-size: small;">(</span><span style="color: #1c00cf;"><span style="font-size: small;">320</span></span><span style="font-size: small;">,</span><span style="color: #1c00cf;"><span style="font-size: small;">320</span></span><span style="font-size: 14pt;"><span style="font-size: small;">);</span></span></p>
<p>}<br />
 <span style="font-size: small;">This sets the size of the popover for showing.Go into interface builder and add a couple controls to ensure you know when it works.<br />
 And finally in your main view controller {.m file}, add the IBAction:</span></p>
<p><span style="font-size: small;">-(</span><span style="color: #aa0d91;"><span style="font-size: small;">IBAction</span></span><span style="font-size: small;">)popOverViewCall:(</span><span style="color: #aa0d91;"><span style="font-size: small;">id</span></span><span style="font-size: small;">)sender{<br />
 </span><span style="color: #3f6e74;"><span style="font-size: small;">FirstDetailViewControllerPopOverControl</span></span><span style="font-size: small;"> </span><span style="font-size: small;">*myViewControllerForPopover = [[</span><span style="color: #3f6e74;"><span style="font-size: small;">FirstDetailViewControllerPopOverControl</span></span><span style="font-size: small;"> </span><span style="font-size: small;"> </span><span style="color: #2e0d6e;"><span style="font-size: small;">alloc</span></span><span style="font-size: small;">] </span><span style="color: #2e0d6e;"><span style="font-size: small;">initWithNibName</span></span><span style="font-size: small;">:</span><span style="color: #c41a16;"><span style="font-size: small;">@&#8221;FirstDetailViewControllerPopOverControl&#8221;</span></span><span style="font-size: small;"> </span><span style="font-size: small;"> </span><span style="color: #2e0d6e;"><span style="font-size: small;">bundle</span></span><span style="font-size: small;">:</span><span style="color: #aa0d91;"><span style="font-size: small;">nil</span></span><span style="font-size: small;"> </span><span style="font-size: small;">];<br />
 </span><span style="color: #5c2699;"><span style="font-size: small;">UIPopoverController</span></span><span style="font-size: small;"> </span><span style="font-size: small;">*popover = [[</span><span style="color: #5c2699;"><span style="font-size: small;">UIPopoverController</span></span><span style="font-size: small;"> </span><span style="color: #2e0d6e;"><span style="font-size: small;">alloc</span></span><span style="font-size: small;">] </span><span style="color: #2e0d6e;"><span style="font-size: small;">initWithContentViewController</span></span><span style="font-size: 14pt;"><span style="font-size: small;">:myViewControllerForPopover];<br />
 </span> </span><span style="color: #aa0d91;"><span style="font-size: small;">self</span></span><span style="font-size: small;">.</span><span style="color: #3f6e74;"><span style="font-size: small;">popoverController</span></span><span style="font-size: small;"> </span><span style="font-size: 14pt;"><span style="font-size: small;">= popover;<br />
 </span> </span><span style="color: #3f6e74;"><span style="font-size: small;">popoverController</span></span><span style="font-size: small;">.</span><span style="color: #5c2699;"><span style="font-size: small;">delegate</span></span><span style="font-size: small;"> </span><span style="font-size: small;">= </span><span style="color: #aa0d91;"><span style="font-size: small;">self</span></span><span style="font-size: small;">;</span></p>
<p>[popover <span style="color: #2e0d6e;"><span style="font-size: small;">release</span></span><span style="font-size: small;">];<br />
 [myViewControllerForPopover </span><span style="color: #2e0d6e;"><span style="font-size: small;">release</span></span><span style="font-size: small;">];</span></p>
<p><span style="color: #5c2699;"><span style="font-size: small;">CGPoint</span></span><span style="font-size: small;"> </span><span style="font-size: small;">point = {</span><span style="color: #1c00cf;"><span style="font-size: small;">200</span></span><span style="font-size: small;">,</span><span style="color: #1c00cf;"><span style="font-size: small;">200</span></span><span style="font-size: small;">}; </span><span style="color: #007400;"><span style="font-size: small;">// Place to put on screen</span></span><span style="font-size: small;"><br />
 </span><span style="color: #5c2699;"><span style="font-size: small;">CGSize</span></span><span style="font-size: small;"> </span><span style="font-size: small;">size = {</span><span style="color: #1c00cf;"><span style="font-size: small;">600</span></span><span style="font-size: small;">,</span><span style="color: #1c00cf;"><span style="font-size: small;">600</span></span><span style="font-size: small;">}; </span><span style="color: #007400;"><span style="font-size: small;">// A content range (see apple docs)</span></span><span style="font-size: small;"><br />
 </span><span style="font-size: small;">[</span><span style="color: #3f6e74;"><span style="font-size: small;">popoverController</span></span><span style="font-size: small;"> </span><span style="color: #2e0d6e;"><span style="font-size: small;">presentPopoverFromRect</span></span><span style="font-size: small;">:</span><span style="color: #2e0d6e;"><span style="font-size: small;">CGRectMake</span></span><span style="font-size: small;">(point.</span><span style="color: #5c2699;"><span style="font-size: small;">x</span></span><span style="font-size: small;">, point.</span><span style="color: #5c2699;"><span style="font-size: small;">y</span></span><span style="font-size: small;">, size.</span><span style="color: #5c2699;"><span style="font-size: small;">width</span></span><span style="font-size: small;">, size.</span><span style="color: #5c2699;"><span style="font-size: small;">height</span></span><span style="font-size: small;">)<br />
 </span><span style="color: #2e0d6e;"><span style="font-size: small;">inView</span></span><span style="font-size: small;">:</span><span style="color: #aa0d91;"><span style="font-size: small;">self</span></span><span style="font-size: small;">.</span><span style="color: #5c2699;"><span style="font-size: small;">view</span></span><span style="font-size: small;"> </span><span style="color: #2e0d6e;"><span style="font-size: small;">permittedArrowDirections</span></span><span style="font-size: small;">:</span><span style="color: #2e0d6e;"><span style="font-size: small;">UIPopoverArrowDirectionAny</span></span><span style="font-size: small;"> </span><span style="color: #2e0d6e;"><span style="font-size: small;">animated</span></span><span style="font-size: small;">:</span><span style="color: #aa0d91;"><span style="font-size: small;">YES</span></span><span style="font-size: 14pt;"><span style="font-size: small;">];</span></span></p>
<p>}<br />
 <span style="font-size: small;"><br />
 Add a button on your main view controller to call the IBAction. That covers it! One of the new features in iPhoneOS3.2 for iPad. See the screenshots for how it should look, code is downloadable below.</span></p>
<p><img class="size-medium wp-image-654    alignleft" title="Screen shot 2010-04-13 at 19.12.00" src="http://duivesteyn.net/wp-content/uploads/2010/04/Screen-shot-2010-04-13-at-19.12.00-235x300.png" alt="" width="235" height="300" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><span style="font-size: xx-small;"><span style="font-size: small;"><span><br />
</span></span></span></p>
<p><br class="spacer_" /></p>
<table border="0" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td><a href="http://duivesteyn.net/wp-content/uploads/2010/04/de-iPad-Popover-Sample.zip"><img class="alignnone size-full wp-image-652" title="iPad Popover Sample Download Xcode Project Tutorial" src="http://duivesteyn.net/wp-content/uploads/2010/04/Screen-shot-2010-04-14-at-10.50.41.png" alt="" width="247" height="125" /></a></td>
<td><a href="http://github.com/duivesteyn-net/iPad-Popover-Sample"><img title="Gitub Sample Code Hosting" src="http://duivesteyn.net/wp-content/uploads/2010/03/github.png" alt="" width="120" height="60" /></a>￼</td>
</tr>
</tbody>
</table>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/04/19/iphone-sdk-ipad-popover-controller/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://duivesteyn.net/2010/04/19/iphone-sdk-ipad-popover-controller/</feedburner:origLink></item>
		<item>
		<title>iPhone SDK – Get Current Touch Location</title>
		<link>http://feedproxy.google.com/~r/de-net/~3/wX3cLkVJHRg/</link>
		<comments>http://duivesteyn.net/2010/04/16/iphone-sdk-get-current-touch-location/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 07:00:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[touch-location]]></category>
		<category><![CDATA[UITouch]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/04/13/iphone-sdk-get-current-touch-location/</guid>
		<description><![CDATA[Quick one today, I’m working on something new. It neeeded the last touch location to display some user input. It took me a little while to figure out how to call the location of the currently touched location, but its simple.
Just paste the following method into a viewcontroller:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// get touch [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 12pt;">Quick one today, I’m working on something new. It neeeded the last touch location to display some user input. It took me a little while to figure out how to call the location of the currently touched location, but its simple.</p>
<p>Just paste the following method into a viewcontroller:</p>
<p></span>- (<span style="color: rgb(170,13,145);">void</span>)touchesMoved:(<span style="color: rgb(92,38,153);">NSSet</span> *)touches withEvent:(<span style="color: rgb(92,38,153);">UIEvent</span> *)event {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(0,116,0);">// get touch event</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(92,38,153);">UITouch</span> *touch = [[event <span style="color: rgb(46,13,110);">allTouches</span>] <span style="color: rgb(46,13,110);">anyObject</span>];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(92,38,153);">CGPoint</span> pos = [touch <span style="color: rgb(46,13,110);">locationInView</span>: [<span style="color: rgb(92,38,153);">UIApplication</span> <span style="color: rgb(46,13,110);">sharedApplication</span>].<span style="color: rgb(46,13,110);">keyWindow</span>];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(46,13,110);">NSLog</span>(<span style="color: rgb(196,26,22);">@&#8221;Position of touch: %.3f, %.3f&#8221;</span>, pos.<span style="color: rgb(92,38,153);">x</span>, pos.<span style="color: rgb(92,38,153);">y</span>);<br />
}</p>
<p>thats it! Check the Console/Log to see the output.<br />
Note, using this over a tableviewcontroller is a different story, that is something I am yet to need, or figure out.</p>
<p><span style="font-size: 12pt;"><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-13at21.10.23.HdXB78fAPxSp.jpg" alt="Screenshot2010-04-13at21.10.23.HdXB78fAPxSp.jpg" width="730" height="385" /></span></p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/04/16/iphone-sdk-get-current-touch-location/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://duivesteyn.net/2010/04/16/iphone-sdk-get-current-touch-location/</feedburner:origLink></item>
		<item>
		<title>iPhoneOS SDK – Custom UISlider Graphics</title>
		<link>http://feedproxy.google.com/~r/de-net/~3/8vznCt2ZJ0c/</link>
		<comments>http://duivesteyn.net/2010/04/15/iphoneos-sdk-custom-uislider-graphics/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 13:15:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[UISlider]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/04/12/iphoneos-sdk-custom-uislider-graphics/</guid>
		<description><![CDATA[Today I am showing how to add graphics to a UISlider in an iPhone application.

Create a new view based application 


2. Add the IBOutlets for the UISliders
In the .h file add:
@interface deCustomSliderViewController : UIViewController {
IBOutlet UISlider *slider1;
 IBOutlet UISlider *slider2;
}
3. Setup the Interface.
Add a couple sliders to deCustomSliderViewController.xib

And then add the IBOutlet Link &#8211; You [...]]]></description>
			<content:encoded><![CDATA[<div><span style="font-size: small;">Today I am showing how to add graphics to a UISlider in an iPhone application.</span></div>
<ol style="list-style-type: decimal;">
<li><span style="font-size: 12pt;">Create a new view based application </span></li>
</ol>
<p><span style="font-size: 12pt;"><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-12at15.16.01.BWLVS6GSBm0y.jpg" alt="Screenshot2010-04-12at15.16.01.BWLVS6GSBm0y.jpg" width="521" height="383" /></span></p>
<p><span style="font-size: 12pt;"><strong>2. Add the IBOutlets for the UISliders</strong></span></p>
<p><span style="font-size: 12pt;">In the .h file add:</span></p>
<p><span style="color: #aa0d91;">@interface</span> deCustomSliderViewController : UIViewController {</p>
<p><span style="color: #aa0d91;">IBOutlet</span> <span style="color: #5c2699;">UISlider</span> *slider1;<br />
 <span style="color: #aa0d91;">IBOutlet</span> <span style="color: #5c2699;">UISlider</span> *slider2;</p>
<p>}</p>
<p><span style="font-size: 16px;">3. <strong>Setup the Interface.</strong></span></p>
<p><span style="font-size: 12pt;">Add a couple sliders to deCustomSliderViewController.xib</span></p>
<p><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-12at15.16.28.sp1lJ5YWNXvi.jpg" alt="Screenshot2010-04-12at15.16.28.sp1lJ5YWNXvi.jpg" width="400" height="582" /></p>
<p>And then add the IBOutlet Link &#8211; You will only need to do one of these.</p>
<p><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-12at15.21.24.3QsjTLPg20UI.jpg" alt="Screenshot2010-04-12at15.21.24.3QsjTLPg20UI.jpg" width="301" height="225" /></p>
<p><br class="spacer_" /></p>
<p><strong>4.Now its time to make them pretty!</strong></p>
<p><span style="font-size: 12pt;">Add your image resources to the project resources folder. You will need one for the bar and one for the knob (the slider bit you touch). I have attached some at the end of this post.</span></p>
<p>I am using these (credit <span style="text-decoration: underline;"><a href="http://www.mynameise.com/renn">http://www.mynameise.com/renn</a></span> <span style="font-size: 12pt;">and <a href="http://365psd.com/day/27/">http://365psd.com/day/27/</a>) : </span></p>
<p><img src="http://duivesteyn.net/wp-content/uploads/2010/04/slider-bg.dc4VNOeb5oj2.jpg" alt="slider-bg.dc4VNOeb5oj2.jpg" width="266" height="11" /><br />
 <span style="font-size: 12pt;"><img src="http://duivesteyn.net/wp-content/uploads/2010/04/slider-knob.Q7fZFMmAxbX4.jpg" alt="slider-knob.Q7fZFMmAxbX4.jpg" width="30" height="36" /></span></p>
<p><span style="font-size: 12pt;"><strong>5. Add the UI Code</strong></span></p>
<p><span style="font-size: 12pt;">The final step is just linking the resources to the IBOutlets. Add the following code in your viewDidLoad or viewWillLoad</span></p>
<p><span style="color: #007400;">//Slider Images</span><br />
 <span style="color: #5c2699;">UIImage</span> *stetchLeftTrack = [[<span style="color: #5c2699;">UIImage</span> <span style="color: #2e0d6e;">imageNamed</span>:<span style="color: #c41a16;">@"slider-bg.png"</span>] <span style="color: #2e0d6e;">stretchableImageWithLeftCapWidth</span>:<span style="color: #1c00cf;">10.0</span> <span style="color: #2e0d6e;">topCapHeight</span>:<span style="color: #1c00cf;">0.0</span>];<br />
 <span style="color: #5c2699;">UIImage</span> *stetchRightTrack = [[<span style="color: #5c2699;">UIImage</span> <span style="color: #2e0d6e;">imageNamed</span>:<span style="color: #c41a16;">@"slider-bg.png"</span>]  <span style="color: #2e0d6e;">stretchableImageWithLeftCapWidth</span>:<span style="color: #1c00cf;">10.0</span> <span style="color: #2e0d6e;">topCapHeight</span>:<span style="color: #1c00cf;">0.0</span>];</p>
<p><span style="color: #007400;">//Slider: Top</span><br />
 <span style="color: #3f6e74;">slider1</span>.<span style="color: #5c2699;">backgroundColor</span> = [<span style="color: #5c2699;">UIColor</span> <span style="color: #2e0d6e;">clearColor</span>];        <br />
 [<span style="color: #3f6e74;">slider1</span> <span style="color: #2e0d6e;">setThumbImage</span>: [<span style="color: #5c2699;">UIImage</span> <span style="color: #2e0d6e;">imageNamed</span>:<span style="color: #c41a16;">@"slider-knob.png"</span>] <span style="color: #2e0d6e;">forState</span>:<span style="color: #2e0d6e;">UIControlStateNormal</span>];<br />
 [<span style="color: #3f6e74;">slider1</span> <span style="color: #2e0d6e;">setMinimumTrackImage</span>:stetchLeftTrack <span style="color: #2e0d6e;">forState</span>:<span style="color: #2e0d6e;">UIControlStateNormal</span>];<br />
 [<span style="color: #3f6e74;">slider1</span> <span style="color: #2e0d6e;">setMaximumTrackImage</span>:stetchRightTrack <span style="color: #2e0d6e;">forState</span>:<span style="color: #2e0d6e;">UIControlStateNormal</span>];<br />
 <span style="color: #3f6e74;">slider1</span>.<span style="color: #5c2699;">minimumValue</span> = <span style="color: #1c00cf;">0.0</span>;<br />
 <span style="color: #3f6e74;">slider1</span>.<span style="color: #5c2699;">maximumValue</span> = <span style="color: #1c00cf;">100.0</span>;<br />
 <span style="color: #3f6e74;">slider1</span>.<span style="color: #5c2699;">continuous</span> = <span style="color: #aa0d91;">YES</span>;<br />
 <span style="color: #3f6e74;">slider1</span>.<span style="color: #5c2699;">value</span> = <span style="color: #1c00cf;">20.0</span>;</p>
<p><span style="color: #007400;">//Slider: Middle</span><br />
 <span style="color: #3f6e74;">slider2</span>.<span style="color: #5c2699;">backgroundColor</span> = [<span style="color: #5c2699;">UIColor</span> <span style="color: #2e0d6e;">clearColor</span>];        <br />
 [<span style="color: #3f6e74;">slider2</span> <span style="color: #2e0d6e;">setThumbImage</span>: [<span style="color: #5c2699;">UIImage</span> <span style="color: #2e0d6e;">imageNamed</span>:<span style="color: #c41a16;">@"slider-knob.png"</span>] <span style="color: #2e0d6e;">forState</span>:<span style="color: #2e0d6e;">UIControlStateNormal</span>];<br />
 [<span style="color: #3f6e74;">slider2</span> <span style="color: #2e0d6e;">setMinimumTrackImage</span>:stetchLeftTrack <span style="color: #2e0d6e;">forState</span>:<span style="color: #2e0d6e;">UIControlStateNormal</span>];<br />
 [<span style="color: #3f6e74;">slider2</span> <span style="color: #2e0d6e;">setMaximumTrackImage</span>:stetchRightTrack <span style="color: #2e0d6e;">forState</span>:<span style="color: #2e0d6e;">UIControlStateNormal</span>];<br />
 <span style="color: #3f6e74;">slider2</span>.<span style="color: #5c2699;">minimumValue</span> = <span style="color: #1c00cf;">0.0</span>;<br />
 <span style="color: #3f6e74;">slider2</span>.<span style="color: #5c2699;">maximumValue</span> = <span style="color: #1c00cf;">100.0</span>;<br />
 <span style="color: #3f6e74;">slider2</span>.<span style="color: #5c2699;">continuous</span> = <span style="color: #aa0d91;">YES</span>;<br />
 <span style="color: #3f6e74;">slider2</span>.<span style="color: #5c2699;">value</span> = <span style="color: #1c00cf;">50.0</span>;</p>
<p>Thats it! It wasn’t too hard at all hey! Run your app and checkout your new sliders. Mine Looks like this:</p>
<p><span style="font-size: 12pt;"><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-12at15.32.32.VwGIIsHQSwar.jpg" alt="Screenshot2010-04-12at15.32.32.VwGIIsHQSwar.jpg" width="290" height="539" /></span></p>
<p><br class="spacer_" /></p>
<p><strong>And thats it!</strong></p>
<p>Downloads:</p>
<p><a href="http://duivesteyn.net/wp-content/uploads/2010/04/UISlider-Images.zip"><img title="Screen shot 2010-04-12 at 15.40.33" src="http://duivesteyn.net/wp-content/uploads/2010/04/Screen-shot-2010-04-12-at-15.40.33.png" alt="" width="276" height="139" /></a></p>
<table border="0" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td><a href="http://duivesteyn.net/wp-content/uploads/2010/04/deCustomSlider.zip"><img class="alignnone size-medium wp-image-636" title="Screen shot 2010-04-12 at 15.40.21" src="http://duivesteyn.net/wp-content/uploads/2010/04/Screen-shot-2010-04-12-at-15.40.21-300x138.png" alt="" width="300" height="138" /></a></td>
<td><a href="http://github.com/duivesteyn-net/deCustomSlider"><img title="github" src="http://duivesteyn.net/wp-content/uploads/2010/03/github.png" alt="" width="120" height="60" /></a>￼</td>
<td></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/04/15/iphoneos-sdk-custom-uislider-graphics/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://duivesteyn.net/2010/04/15/iphoneos-sdk-custom-uislider-graphics/</feedburner:origLink></item>
		<item>
		<title>IPhone OS SDK – Use a Zombie to get a better errors about memory allocation</title>
		<link>http://feedproxy.google.com/~r/de-net/~3/7qQiVChNsXo/</link>
		<comments>http://duivesteyn.net/2010/04/14/iphone-os-sdk-use-a-zombie-to-get-a-better-errors-about-memory-allocation/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 07:00:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[NSZombie]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/04/11/iphone-os-sdk-use-a-zombie-to-get-a-better-errors-about-memory-allocation/</guid>
		<description><![CDATA[Just a quick note, theres lots of information about NSZombie (NSZombieEnabled), heres the way to enable them:
1. Project -&#62; Edit Active Executable

2. Goto the Arguments Tab



Set the Variable NSZombieEnabled and set it to YES (note: its Zombie, not Zombies!)

I’ll leave it as an exercise to find out more about NSZombie, its great for memory debugging.
]]></description>
			<content:encoded><![CDATA[<p>Just a quick note, theres lots of information about NSZombie (NSZombieEnabled), heres the way to enable them:</p>
<p>1. Project -&gt; Edit Active Executable<br />
<img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-11at13.46.39.Qrxcr6fUafop.jpg" alt="Screenshot2010-04-11at13.46.39.Qrxcr6fUafop.jpg" width="358" height="522" /></p>
<p>2. Goto the Arguments Tab<br />
<img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-11at13.50.31.LmqbaOs3Zmrh.jpg" alt="Screenshot2010-04-11at13.50.31.LmqbaOs3Zmrh.jpg" width="755" height="760" /></p>
<p><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-11at13.50.34.zbnOfZ81E3Ob.jpg" alt="Screenshot2010-04-11at13.50.34.zbnOfZ81E3Ob.jpg" width="666" height="264" /></p>
<ol style="list-style-type: decimal">
<li>Set the Variable NSZombieEnabled and set it to YES (note: its Zombie, not Zombies!)</li>
</ol>
<p>I’ll leave it as an exercise to find out more about NSZombie, its great for memory debugging.</p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/04/14/iphone-os-sdk-use-a-zombie-to-get-a-better-errors-about-memory-allocation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://duivesteyn.net/2010/04/14/iphone-os-sdk-use-a-zombie-to-get-a-better-errors-about-memory-allocation/</feedburner:origLink></item>
		<item>
		<title>iPhone SDK – Animate button press (highlight) with alternate buttons</title>
		<link>http://feedproxy.google.com/~r/de-net/~3/g6kjICHM7ys/</link>
		<comments>http://duivesteyn.net/2010/04/13/iphone-sdk-animate-button-press-highlight-with-alternate-buttons/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 07:00:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[Highlighted]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[UIButton]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/04/08/iphone-sdk-animate-button-press-highlight-with-alternate-buttons/</guid>
		<description><![CDATA[I was interested in implementing a simple button, which had a normal state and a ‘pressed’ or ‘highlighted’ state when being touched. I found an endless supply of lines of code, but after a little more playing around I found something new. And, it uses my fantastic principle of ‘simple’!
Firstly, what does the button look [...]]]></description>
			<content:encoded><![CDATA[<p>I was interested in implementing a simple button, which had a normal state and a ‘pressed’ or ‘highlighted’ state when being touched. I found an endless supply of lines of code, but after a little more playing around I found something new. And, it uses my fantastic principle of ‘simple’!</p>
<p>Firstly, what does the button look like? Its very simple really, its a modest edit button. The left image is the Normal state, the right button is for the highlighted state.</p>
<p><img src="http://duivesteyn.net/wp-content/uploads/2010/04/button-edit.aRIFeugod4Dy.jpg" alt="button-edit.aRIFeugod4Dy.jpg" width="51" height="25" /><img src="http://duivesteyn.net/wp-content/uploads/2010/04/button-edit-toucheddown.j8VuddV07gAQ.jpg" alt="button-edit-toucheddown.j8VuddV07gAQ.jpg" width="51" height="25" /></p>
<p>And here is a (blurred) pic of the edit button in action, in my current development app. I did say it is modest.</p>
<p><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screen-shot-2010-04-07-at-23.31.28.ZpA61gVboFc3.jpg" alt="Screen-shot-2010-04-07-at-23.31.28.ZpA61gVboFc3.jpg" width="400" height="465" /></p>
<p><strong>So how is it done?</strong></p>
<p><strong> </strong></p>
<p>Well this one is 100% thanks to <a href="http://en.wikipedia.org/wiki/Interface_Builde">Interface Builder</a> and it should be quite easy to follow.</p>
<p>Well, open Interface Builder, create a UIButton and add an Image to the button (as one normally would). See the below screenshot.<br />
 <img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-07at23.31.45.7ZbhOvcKdeMV.jpg" alt="Screenshot2010-04-07at23.31.45.7ZbhOvcKdeMV.jpg" width="280" height="564" /></p>
<p>Now, Do you see where it says ‘Default State Configuration’ just under the ‘type’ setting? Press it</p>
<p><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-07at23.31.54.wVlfeQWuTcPN.jpg" alt="Screenshot2010-04-07at23.31.54.wVlfeQWuTcPN.jpg" width="293" height="114" /><br />
 We are now given 4 states where we are able to alter the button under, all without requiring any code at all!<br />
 <strong>Default State</strong>: Button is in its normal state<br />
 <strong>Highlighted State:</strong> Button is being pressed (this is the one we want)<br />
 <strong>Selected State</strong>: Extra code has registered this button as ‘active’ and so its in ‘selected’ mode<br />
 <strong>Disabled State:</strong> Extra code has registered this button as ‘disabled’ and so its in ‘disabled’ mode</p>
<p>So now I would go into ‘Highlighted State’ and just change the image, to the second edit image (see below).</p>
<p><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-07at23.31.56.WW7EQZ1udtpy.jpg" alt="Screenshot2010-04-07at23.31.56.WW7EQZ1udtpy.jpg" width="289" height="567" /></p>
<p>And thats it! No code at all. Build your app and test it!</p>
<p><strong>Future Exercise:</strong><br />
 Create the entire button without even the jpgs (Skill: Beginner)</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><strong>Download</strong>: PSD Files (free for personal/commercial use)</p>
<p><a href="http://duivesteyn.net/wp-content/uploads/2010/04/post-edit-button-without-code.zip" target="_blank"><img class="alignnone size-full wp-image-608" title="ps-download" src="http://duivesteyn.net/wp-content/uploads/2010/04/ps-download.png" alt="" width="651" height="205" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/04/13/iphone-sdk-animate-button-press-highlight-with-alternate-buttons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://duivesteyn.net/2010/04/13/iphone-sdk-animate-button-press-highlight-with-alternate-buttons/</feedburner:origLink></item>
		<item>
		<title>iPhone OS SDK – Single time showing popup for users</title>
		<link>http://feedproxy.google.com/~r/de-net/~3/ssA9jrQXrE4/</link>
		<comments>http://duivesteyn.net/2010/04/12/iphone-os-sdk-single-time-showing-popup-for-users/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 07:00:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/04/02/iphone-os-sdk-single-time-showing-popup-for-users/</guid>
		<description><![CDATA[It may sometimes be useful to show a one time reminder to your user in your application. This might be asking for a iTunes review, additions to social networks or any other task that It may be rude to ask more than once.
That is exactly what I have put into my application SavingsGoal, with a [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 12pt;">It may sometimes be useful to show a one time reminder to your user in your application. This might be asking for a iTunes review, additions to social networks or any other task that It may be rude to ask more than once.</p>
<p>That is exactly what I have put into my application SavingsGoal, with a single time popup in the about screen. This is shown in detail in the example below:</p>
<p>First in viewDidLoad(), I have a reference to the firstViewSocialPopup class.</p>
<p>- (</span><span style="font-size: 12pt; color: rgb(170,13,145);">void</span><span style="font-size: 12pt;">)viewDidLoad {<br />
    [</span><span style="font-size: 12pt; color: rgb(170,13,145);">super</span> <span style="font-size: 12pt;"></span><span style="font-size: 12pt; color: rgb(46,13,110);">viewDidLoad</span><span style="font-size: 12pt;">];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="font-size: 12pt; color: rgb(0,116,0);">//Internet Links</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="font-size: 12pt;"></span><span style="font-size: 12pt; color: rgb(63,110,116);">websiteURL</span> <span style="font-size: 12pt;">= </span><span style="font-size: 12pt; color: rgb(196,26,22);">@“</span><span style="font-size: 12pt;"><a href="http://apps.duivesteyn.net">http://apps.duivesteyn.net</a></span><span style="font-size: 12pt; color: rgb(196,26,22);">&#8220;</span><span style="font-size: 12pt;">;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="font-size: 12pt; color: rgb(63,110,116);">supportEmail</span> <span style="font-size: 12pt;">= </span><span style="font-size: 12pt; color: rgb(196,26,22);">@“</span><span style="font-size: 12pt;"><a href="mailto:apps@duivesteyn.net">apps@duivesteyn.net</a></span><span style="font-size: 12pt; color: rgb(196,26,22);">&#8220;</span><span style="font-size: 12pt;">;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="font-size: 12pt; color: rgb(63,110,116);">facebookURL</span> <span style="font-size: 12pt;">= </span><span style="font-size: 12pt; color: rgb(196,26,22);">@“</span><span style="font-size: 12pt;"><a href="http://www.facebook.com/apps/application.php?id=107880612574963">http://www.facebook.com/apps/application.php?id=107880612574963</a></span><span style="font-size: 12pt; color: rgb(196,26,22);">&#8220;</span><span style="font-size: 12pt;">;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="font-size: 12pt; color: rgb(63,110,116);">twitterURL</span> <span style="font-size: 12pt;">= </span><span style="font-size: 12pt; color: rgb(196,26,22);">@“de_applications&#8221;</span><span style="font-size: 12pt;">;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[</span><span style="font-size: 12pt; color: rgb(170,13,145);">self</span> <span style="font-size: 12pt;"></span><span style="font-size: 12pt; color: rgb(38,71,75);">firstViewSocialPopup</span><span style="font-size: 12pt;">];<br />
}</p>
<p>in my .h header file, I have of course added:</p>
<p></span>-(<span style="color: rgb(170,13,145);">void</span>)firstViewSocialPopup;</p>
<p>Back in the .m file class I have the method firstViewSocialPopup, which is just checking a NSUserDefaults setting and displaying a UIAlert.</p>
<p>-(<span style="color: rgb(170,13,145);">void</span>)firstViewSocialPopup{<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(92,38,153);">NSString</span> *socialPopup = [<span style="color: rgb(92,38,153);">NSString</span> <span style="color: rgb(46,13,110);">stringWithFormat</span>:<span style="color: rgb(196,26,22);">@"%@"</span>, [[<span style="color: rgb(92,38,153);">NSUserDefaults</span> <span style="color: rgb(46,13,110);">standardUserDefaults</span>] <span style="color: rgb(46,13,110);">objectForKey</span>:<span style="color: rgb(196,26,22);">@&#8221;toggle_social&#8221;</span>]];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(46,13,110);">NSLog</span>(<span style="color: rgb(196,26,22);">@&#8221;Social Reminder Status: %@&#8221;</span>,socialPopup);<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(170,13,145);">if</span> ([socialPopup <span style="color: rgb(46,13,110);">isEqualToString</span>: <span style="color: rgb(196,26,22);">@"YES"</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);">UIAlertView</span> *alert = [[<span style="color: rgb(92,38,153);">UIAlertView</span> <span style="color: rgb(46,13,110);">alloc</span>] <span style="color: rgb(46,13,110);">initWithTitle</span>:<span style="color: rgb(196,26,22);">@&#8221;Social Networking&#8221;</span> <span style="color: rgb(46,13,110);">message</span>:<span style="color: rgb(196,26,22);">@&#8221;Would you help the development team by adding them on Social Networks?&#8221;</span> <span style="color: rgb(46,13,110);">delegate</span>:<span style="color: rgb(170,13,145);">self</span> <span style="color: rgb(46,13,110);">cancelButtonTitle</span>:<span style="color: rgb(196,26,22);">@&#8221;No Thanks&#8221;</span> <span style="color: rgb(46,13,110);">otherButtonTitles</span>:<span style="color: rgb(196,26,22);">@&#8221;Twitter&#8221;</span>,<span style="color: rgb(196,26,22);">@&#8221;Facebook&#8221;</span>,<span style="color: rgb(170,13,145);">nil</span>];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[alert <span style="color: rgb(46,13,110);">show</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);">NSUserDefaults</span> *defaults = [<span style="color: rgb(92,38,153);">NSUserDefaults</span> <span style="color: rgb(46,13,110);">standardUserDefaults</span>];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[defaults <span style="color: rgb(46,13,110);">setObject</span>:<span style="color: rgb(196,26,22);">@"NO"</span> <span style="color: rgb(46,13,110);">forKey</span>:<span style="color: rgb(196,26,22);">@"toggle_social"</span>];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
}</p>
<p>THe UIAlert has delegate self and so sends the button pressed to the UIAlertView delegate (which is its self). This will call the class: (<span style="color: rgb(170,13,145);">void</span>)alertView: (<span style="color: rgb(92,38,153);">UIAlertView</span> *)alertView clickedButtonAtIndex: (<span style="color: rgb(92,38,153);">NSInteger</span>)buttonIndex</p>
<p>And so, in the same class (.m file) I have the following method:</p>
<p>- (<span style="color: rgb(170,13,145);">void</span>)alertView: (<span style="color: rgb(92,38,153);">UIAlertView</span> *)alertView clickedButtonAtIndex: (<span style="color: rgb(92,38,153);">NSInteger</span>)buttonIndex<br />
{<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(46,13,110);">NSLog</span>(<span style="color: rgb(196,26,22);">@“in alertView action, buttonIndex: %u&#8221;</span>,buttonIndex);<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(170,13,145);">if</span> (buttonIndex==<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;<span style="color: rgb(46,13,110);">NSLog</span>(<span style="color: rgb(196,26,22);">@“Open Twitter&#8221;</span>);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(0,116,0);">//Custom Open Twitter Page Code</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(63,110,116);">deHelpers</span> *dehelper = [[<span style="color: rgb(63,110,116);">deHelpers</span> <span style="color: rgb(46,13,110);">alloc</span>] <span style="color: rgb(46,13,110);">init</span>];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[dehelper <span style="color: rgb(38,71,75);">openTwitterAppForFollowingUser</span>:<span style="color: rgb(196,26,22);">@“de_applications"</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;} <span style="color: rgb(170,13,145);">else</span> <span style="color: rgb(170,13,145);">if</span> (buttonIndex==<span style="color: rgb(28,0,207);">2</span>) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(46,13,110);">NSLog</span>(<span style="color: rgb(196,26,22);">@“Open Facebook&#8221;</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);">//Custom Open Twitter Page Code</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(63,110,116);">url</span> = [<span style="color: rgb(92,38,153);">NSURL</span> <span style="color: rgb(46,13,110);">URLWithString</span>:<span style="color: rgb(196,26,22);">@“</span><a href="http://www.facebook.com/apps/application.php?id=107880612574963">http://www.facebook.com/apps/application.php?id=107880612574963</a><span style="color: rgb(196,26,22);">"</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(92,38,153);">NSURLRequest</span> *request = [<span style="color: rgb(92,38,153);">NSURLRequest</span> <span style="color: rgb(46,13,110);">requestWithURL</span>:<span style="color: rgb(63,110,116);">url</span>];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(63,110,116);">PWWebViewController</span> *webController = [[<span style="color: rgb(63,110,116);">PWWebViewController</span> <span style="color: rgb(46,13,110);">alloc</span>] <span style="color: rgb(38,71,75);">initWithRequest</span>:request];<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);">UINavigationController</span> *<span style="color: rgb(92,38,153);">navigationController</span> = [[<span style="color: rgb(92,38,153);">UINavigationController</span> <span style="color: rgb(46,13,110);">alloc</span>] <span style="color: rgb(46,13,110);">initWithRootViewController</span>:webController];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: rgb(92,38,153);">UIBarButtonItem</span> *cancelButton = [[<span style="color: rgb(92,38,153);">UIBarButtonItem</span> <span style="color: rgb(46,13,110);">alloc</span>] <span style="color: rgb(46,13,110);">initWithBarButtonSystemItem</span>:<span style="color: rgb(46,13,110);">UIBarButtonSystemItemCancel</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;  <span style="color: rgb(46,13,110);">target</span>:<span style="color: rgb(170,13,145);">self</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;  <span style="color: rgb(46,13,110);">action</span>:<span style="color: rgb(170,13,145);">@selector</span>(<span style="color: rgb(38,71,75);">dismissModal</span>)];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;webController.<span style="color: rgb(92,38,153);">navigationItem</span>.<span style="color: rgb(92,38,153);">leftBarButtonItem</span> = cancelButton;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[cancelButton <span style="color: rgb(46,13,110);">release</span>];<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[<span style="color: rgb(170,13,145);">self</span> <span style="color: rgb(46,13,110);">presentModalViewController</span>:<span style="color: rgb(92,38,153);">navigationController</span> <span style="color: rgb(46,13,110);">animated</span>:<span style="color: rgb(170,13,145);">YES</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);">navigationController</span> <span style="color: rgb(46,13,110);">release</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;}<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
}</p>
<p>Hopefully, you can see the idea, its quite simple. I have included some extra parts in the code for those who are interested exactly how I implement the popup actions. Its using a previously discussed control: <span style="color: rgb(63,110,116);">PWWebViewController</span> and some <a href="http://drobnik.com">DrTouch</a> code: <span style="color: rgb(38,71,75);">openTwitterAppForFollowingUser.</p>
<p></span><br />
<span style="font-size: 12pt;"><img src="http://duivesteyn.net/wp-content/uploads/2010/04/social.hRbsv9NjXBdY.jpg" alt="social.hRbsv9NjXBdY.jpg" width="332" height="488" /></span></p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/04/12/iphone-os-sdk-single-time-showing-popup-for-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://duivesteyn.net/2010/04/12/iphone-os-sdk-single-time-showing-popup-for-users/</feedburner:origLink></item>
		<item>
		<title>See some of the new stuff in iPhone 4.0</title>
		<link>http://feedproxy.google.com/~r/de-net/~3/86-AuAsq7mM/</link>
		<comments>http://duivesteyn.net/2010/04/09/see-some-of-the-new-stuff-in-iphone-4-0/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 08:31:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/?p=613</guid>
		<description><![CDATA[The link is here: http://events.apple.com.edgesuite.net/1004fk8d5gt/event/
]]></description>
			<content:encoded><![CDATA[<p>The link is here: <a href="http://events.apple.com.edgesuite.net/1004fk8d5gt/event/">http://events.apple.com.edgesuite.net/1004fk8d5gt/event/</a><a href="http://duivesteyn.net/wp-content/uploads/2010/04/iphone-os-preview-hero20100407.png" rel="lightbox[613]"><img class="alignright size-medium wp-image-614" title="iphone-os-preview-hero20100407" src="http://duivesteyn.net/wp-content/uploads/2010/04/iphone-os-preview-hero20100407-300x274.png" alt="" width="300" height="274" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/04/09/see-some-of-the-new-stuff-in-iphone-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://duivesteyn.net/2010/04/09/see-some-of-the-new-stuff-in-iphone-4-0/</feedburner:origLink></item>
		<item>
		<title>iPhone OS SDK – Insert a random Number</title>
		<link>http://feedproxy.google.com/~r/de-net/~3/DNKrXMxFxrg/</link>
		<comments>http://duivesteyn.net/2010/04/09/iphone-os-sdk-insert-a-random-number/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 07:00:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/04/02/iphone-os-sdk-insert-a-random-number/</guid>
		<description><![CDATA[Generating a random number is a simple task in Objective-C.
all you really need to do is: 
 int random = random();
Then you can use the integer as you normally would.
But wait..is it possible that I keep getting the same random numbers?
Try the following code in an empty Xcode Project:
int generated;
 for (int i =0; i&#60;10; [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 12pt;">Generating a random number is a simple task in Objective-C.</span></p>
<p>all you really need to do is: <br />
 <span style="color: #aa0d91;">int</span> random = <span style="color: #2e0d6e;">random</span>();</p>
<p>Then you can use the integer as you normally would.</p>
<p>But wait..is it possible that I keep getting the same random numbers?</p>
<p>Try the following code in an empty Xcode Project:</p>
<p><span style="color: #aa0d91;">int</span> generated;</p>
<p> <span style="color: #aa0d91;">for</span> (<span style="color: #aa0d91;">int</span> i =<span style="color: #1c00cf;">0</span>; i&lt;<span style="color: #1c00cf;">10</span>; i++) {<br />
 generated = <span style="color: #2e0d6e;">abs</span>(<span style="color: #1c00cf;">100000</span>*(<span style="color: #2e0d6e;">random</span>()));<br />
 <span style="color: #2e0d6e;">NSLog</span>(<span style="color: #c41a16;">@&#8221;New Random Key: %d&#8221;</span>,generated);<br />
 }</p>
<p>This gives the output of:<br />
 <span style="font-size: 12pt;"><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-02at14.14.58.j18TEMlrVoXN.jpg" alt="Screenshot2010-04-02at14.14.58.j18TEMlrVoXN.jpg" width="846" height="497" /></span><br />
 And yes, they are the same 10 randomly generated numbers! The random number sequence by default is regular and is based off local computer properties. (Note: see how I ran the code twice and I get the same 10 random numbers).</p>
<p>There is one more line that can aid the initial random() function, and makes the start a little less random.</p>
<p><span style="color: #007400;">//Real Randomness</span><br />
 <span style="color: #2e0d6e;">srandom</span>(<span style="color: #2e0d6e;">time</span>(<span style="color: #aa0d91;">NULL</span>));</p>
<p>Put this before the use of random().</p>
<p>This now sets a new starting point for the random number generator and gives output like one would expect.</p>
<p><span style="color: #007400;">//Real Randomness</span><br />
 <span style="color: #2e0d6e;">srandom</span>(<span style="color: #2e0d6e;">time</span>(<span style="color: #aa0d91;">NULL</span>));</p>
<p> <span style="color: #aa0d91;">int</span> generated;</p>
<p> <span style="color: #aa0d91;">for</span> (<span style="color: #aa0d91;">int</span> i =<span style="color: #1c00cf;">0</span>; i&lt;<span style="color: #1c00cf;">10</span>; i++) {<br />
 generated = <span style="color: #2e0d6e;">abs</span>(<span style="color: #1c00cf;">100000</span>*(<span style="color: #2e0d6e;">random</span>()));<br />
 <span style="color: #2e0d6e;">NSLog</span>(<span style="color: #c41a16;">@&#8221;New Random Key: %d&#8221;</span>,generated);<br />
 }</p>
<p>This gives the output: <span style="font-size: 12pt;"><img src="http://duivesteyn.net/wp-content/uploads/2010/04/Screenshot2010-04-02at14.15.38.KqQYLXoKVjJM.jpg" alt="Screenshot2010-04-02at14.15.38.KqQYLXoKVjJM.jpg" width="846" height="497" /></span></p>
<p>There is one better function to use in place of all of the above. Just use</p>
<p>arc4random()</p>
<p>It seems to be more popular and improves generation with unique-randoms. I use arc4random and this is the best way to quickly generate a random number in Objective-C.</p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/04/09/iphone-os-sdk-insert-a-random-number/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://duivesteyn.net/2010/04/09/iphone-os-sdk-insert-a-random-number/</feedburner:origLink></item>
	</channel>
</rss>
