<?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; uialertview</title>
	<atom:link href="http://duivesteyn.net/tag/uialertview/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; UIAlert &amp; UIAlert Action on button click</title>
		<link>http://duivesteyn.net/2010/03/18/iphone-os-sdk-uialert-uialert-action-on-button-click/</link>
		<comments>http://duivesteyn.net/2010/03/18/iphone-os-sdk-uialert-uialert-action-on-button-click/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 14:24:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[UIAlert]]></category>
		<category><![CDATA[uialertview]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/03/18/iphone-os-sdk-uialert-uialert-action-on-button-click/</guid>
		<description><![CDATA[Using a UIAlertView in apps is very common and surprisingly complex. Its 2 lines, but comparing to VBasic its complicated. This is done by: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@&#8221;Welcome to Savings Goal&#8221; message:@&#8221;Please press the red button to setup your savings goal and current amount saved.&#8221; delegate:self cancelButtonTitle:nil otherButtonTitles:@&#8221;Ok Lets Save!&#8221;,nil]; [alert show]; These [...]]]></description>
			<content:encoded><![CDATA[<p>Using a UIAlertView in apps is very common and surprisingly complex. Its 2 lines, but comparing to VBasic its complicated. This is done by:</p>
<p>
 <span style="color: #5c2699;">UIAlertView</span> *alert = [[<span style="color: #5c2699;">UIAlertView</span> <span style="color: #2e0d6e;">alloc</span>] <span style="color: #2e0d6e;">initWithTitle</span>:<span style="color: #c41a16;">@&#8221;Welcome to Savings Goal&#8221;</span> <span style="color: #2e0d6e;">message</span>:<span style="color: #c41a16;">@&#8221;Please press the red button to setup your savings goal and current amount saved.&#8221;</span> <span style="color: #2e0d6e;">delegate</span>:<span style="color: #aa0d91;">self</span> <span style="color: #2e0d6e;">cancelButtonTitle</span>:<span style="color: #aa0d91;">nil</span> <span style="color: #2e0d6e;">otherButtonTitles</span>:<span style="color: #c41a16;">@&#8221;Ok Lets Save!&#8221;</span>,<span style="color: #aa0d91;">nil</span>];<br />
 [alert <span style="color: #2e0d6e;">show</span>];</p>
<p> These two lines I keep using over and over again. They form a very common copy and paste in my projects.<br />
 More interesting is performing an action on a button click in the UIAlertView. Lets say you have 2 buttons (buttonIndex 0 and 1). use the following method to execute code on that button press. <span style="font-size: 12pt;"><br />
 </span></p>
<p>- (<span style="color: #aa0d91;">void</span>)alertView: (<span style="color: #5c2699;">UIAlertView</span> *)alertView clickedButtonAtIndex: (<span style="color: #5c2699;">NSInteger</span>)buttonIndex<br />
 {<br />
 if (buttonIndex==0) {<br />
 <span style="color: #2e0d6e;">NSLog</span>(<span style="color: #c41a16;">@&#8221;In AlertView Delegate&#8221;</span>);<br />
 <span style="color: #007400;">//start a timer</span><br />
 <span style="color: #3f6e74;">timer</span> = [<span style="color: #5c2699;">NSTimer</span> <span style="color: #2e0d6e;">scheduledTimerWithTimeInterval</span>:<span style="color: #1c00cf;">2</span> <span style="color: #2e0d6e;">target</span>:<span style="color: #aa0d91;">self</span> <span style="color: #2e0d6e;">selector</span>:<span style="color: #aa0d91;">@selector</span>(<span style="color: #26474b;">timerVoid</span>) <span style="color: #2e0d6e;">userInfo</span>:<span style="color: #aa0d91;">nil</span> <span style="color: #2e0d6e;">repeats</span>:<span style="color: #aa0d91;">YES</span>];<br />
 }</p>
<p> }</p>
<p>This will start a timer (NSTimer *timer), when the first button is pressed in an UIAlert. For UIAlerts with multiple buttons, you should use the int buttonIndex to detect which button was pressed.</p>
<p>Thats all for today, enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/03/18/iphone-os-sdk-uialert-uialert-action-on-button-click/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Development &#8211; Learning to use a date spinner (date picker)</title>
		<link>http://duivesteyn.net/2010/01/21/iphone-development-learning-to-use-a-date-spinner-date-picker/</link>
		<comments>http://duivesteyn.net/2010/01/21/iphone-development-learning-to-use-a-date-spinner-date-picker/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 19:52:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[uialertview]]></category>
		<category><![CDATA[uidatepicker]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/?p=68</guid>
		<description><![CDATA[The imfamous iPhone date reel/spinner/picker is easily implemented into your own custom iPhone app. The Class Reference for the UIDatePicker is available here. I would like to share a simple project I made to help understand the UIDate Picker. This was based on the iPhone Developers Cookbook Example. The project is a simple date spinner which [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://duivesteyn.net/wp-content/uploads/2010/01/Screen-shot-2010-01-21-at-8.38.41-PM.png" rel="lightbox[68]"><img class="size-medium wp-image-71 alignright" title="Screen shot 2010-01-21 at 8.38.41 PM" src="http://duivesteyn.net/wp-content/uploads/2010/01/Screen-shot-2010-01-21-at-8.38.41-PM-300x204.png" alt="" width="300" height="204" /></a>The imfamous iPhone date reel/spinner/picker is easily implemented into your own custom iPhone app. The Class Reference for the UIDatePicker is available <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIDatePicker_Class/Reference/UIDatePicker.html" target="_blank">here</a>.</p>
<p>I would like to share a simple project I made to help understand the UIDate Picker. This was based on the <a href="http://www.amazon.com/iPhone-Developers-Cookbook-Building-Applications/dp/0321555457" target="_blank">iPhone Developers Cookbook Example</a>.</p>
<p>The project is a simple date spinner which once it sets on a date sends a UIAlert of the date. It outlines well the UIDate Picker and an UIAlert. The project is extremely simple, but hopefully someone will find it useful.<span id="more-68"></span></p>
<p><strong>UIDatePicker Code:</strong><br />
<code>// Add the picker<br />
float height = 216.0f;<br />
pickerView = [[UIDatePicker alloc] initWithFrame:CGRectMake(0.0f, 416.0f - height, 320.0f, height)];<br />
pickerView.datePickerMode = UIDatePickerModeDate;<br />
[pickerView addTarget:self action:@selector(changedDate:) forControlEvents:UIControlEventValueChanged];<br />
[self.view addSubview:pickerView];<br />
[pickerView release];</code></p>
<p><strong>UIAlert Code:</strong><br />
<code>NSString *message = caldate;<br />
UIAlertView *baseAlert = [[UIAlertView alloc]  initWithTitle:@"" message:message delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];<br />
[baseAlert show];</code></p>
<p><strong>Project Screenshots</strong></p>
<p><img class="alignnone size-full wp-image-73" title="Screen shot 2010-01-21 at 8.38.52 PM" src="http://duivesteyn.net/wp-content/uploads/2010/01/Screen-shot-2010-01-21-at-8.38.52-PM.png" alt="" width="264" height="490" /><a href="http://duivesteyn.net/wp-content/uploads/2010/01/Screen-shot-2010-01-21-at-8.38.50-PM.png" rel="lightbox[68]"><img class="alignnone size-full wp-image-72" title="Screen shot 2010-01-21 at 8.38.50 PM" src="http://duivesteyn.net/wp-content/uploads/2010/01/Screen-shot-2010-01-21-at-8.38.50-PM.png" alt="" width="264" height="490" /></a></p>
<p style="text-align: center;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;"><strong>Project File</strong></p>
<ul>
<li><a href="http://duivesteyn.net/wp-content/uploads/2010/01/iPhoneDev-DatePicker-with-UIAlertView-Example.zip">iPhoneDev &#8211; DatePicker with UIAlertView Example</a></li>
</ul>
<p style="text-align: left;"><strong>References</strong></p>
<ul>
<li>iPhone Cookbook</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/01/21/iphone-development-learning-to-use-a-date-spinner-date-picker/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
