<?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>Dynamic Leap Technology Inc.</title>
	<atom:link href="http://dynamic-leap.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dynamic-leap.com</link>
	<description>Software Development</description>
	<lastBuildDate>Mon, 05 Apr 2010 20:17:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Test</title>
		<link>http://dynamic-leap.com/test/</link>
		<comments>http://dynamic-leap.com/test/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 20:17:58 +0000</pubDate>
		<dc:creator>Andrei Iancu</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://dynamic-leap.com/?p=485</guid>
		<description><![CDATA[Test
]]></description>
			<content:encoded><![CDATA[<p>Test</p>
]]></content:encoded>
			<wfw:commentRss>http://dynamic-leap.com/test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google is giving away Nexus One phones</title>
		<link>http://dynamic-leap.com/free-nexus-one/</link>
		<comments>http://dynamic-leap.com/free-nexus-one/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 20:06:44 +0000</pubDate>
		<dc:creator>Andrei Iancu</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google IO]]></category>
		<category><![CDATA[Nexus One]]></category>

		<guid isPermaLink="false">http://dynamic-leap.com/?p=478</guid>
		<description><![CDATA[Last year, in 2009, the Google I/O participants got a free Android phone when they arrived at the conference in San Francisco. This year Google decided to send all <a href="http://code.google.com/events/io/2010/about.html">Google I/O</a> participants a free Nexus One phone two months ahead, so they have time to install the development environment and play with the Android SDK before they come. Great idea, and I'm so happy that I registered. I look forward to find out what other surprises Google has in store.]]></description>
			<content:encoded><![CDATA[<p><a href="http://dynamic-leap.com/wp-content/uploads/2010/04/nexus_one.jpg" rel="lightbox[478]"><img src="http://dynamic-leap.com/wp-content/uploads/2010/04/nexus_one-150x150.jpg" alt="Android Phone" title="Nexus One" width="150" height="150" class="alignleft size-thumbnail wp-image-480" /></a>Last year, in 2009, the Google I/O participants got a free Android phone when they arrived at the conference in San Francisco. This year Google decided to send all <a href="http://code.google.com/events/io/2010/about.html">Google I/O</a> participants a free Nexus One phone two months ahead, so they have time to install the development environment and play with the Android SDK before they come.<br />
Great idea, and I&#8217;m so happy that I registered. I look forward to find out what other surprises Google has in store.</p>
]]></content:encoded>
			<wfw:commentRss>http://dynamic-leap.com/free-nexus-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Developer &#8211; Mobile</title>
		<link>http://dynamic-leap.com/software-developer-mobile2/</link>
		<comments>http://dynamic-leap.com/software-developer-mobile2/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 21:08:23 +0000</pubDate>
		<dc:creator>Andrei Iancu</dc:creator>
				<category><![CDATA[Jobs]]></category>
		<category><![CDATA[iPad job]]></category>
		<category><![CDATA[iPhone developer]]></category>

		<guid isPermaLink="false">http://dynamic-leap.com/?p=464</guid>
		<description><![CDATA[


Job title
Software Developer


Job ID
SD10-03


Salary
$40,000 &#8211; $50.000 annual


Date
March 23, 2010


Location
Vancouver, Canada


Job type
Full Time


Job description
Dynamic Leap Technology Inc. is a startup company providing development and training services in the mobile devices space, with a focus on Apple’s iPhone. Dynamic Leap started experiencing a rapid growth and is looking for enthusiastic software developers interested to join the team, [...]]]></description>
			<content:encoded><![CDATA[<table border="0" cellspacing="0" cellpadding="0" width="540">
<tbody>
<tr>
<td width="127" valign="top"><strong>Job title</strong></td>
<td width="413" valign="top">Software Developer</td>
</tr>
<tr>
<td width="127" valign="top"><strong>Job ID</strong></td>
<td width="413" valign="top">SD10-03</td>
</tr>
<tr>
<td width="127" valign="top"><strong>Salary</strong></td>
<td width="413" valign="top">$40,000 &#8211; $50.000 annual</td>
</tr>
<tr>
<td width="127" valign="top"><strong>Date</strong></td>
<td width="413" valign="top">March 23, 2010</td>
</tr>
<tr>
<td width="127" valign="top"><strong>Location</strong></td>
<td width="413" valign="top">Vancouver, Canada</td>
</tr>
<tr>
<td width="127" valign="top"><strong>Job type</strong></td>
<td width="413" valign="top">Full Time</td>
</tr>
<tr>
<td width="127" valign="top"><strong>Job description</strong></td>
<td width="413" valign="top">Dynamic Leap Technology Inc. is a startup company providing development and training services in the mobile devices space, with a focus on Apple’s iPhone. Dynamic Leap started experiencing a rapid growth and is looking for enthusiastic software developers interested to join the team, working on leading edge mobile and Web 2.0 projects.</p>
<p>With Dynamic Leap you will build exciting new software used on mobile devices like the iPhone, iPod Touch, iPad, Blackberry, and phones running Google’s Android.</p>
<p><strong>Requirements:</strong></p>
<ul>
<li>Strong programming skills in C, Objective-C, C++ and Java</li>
<li>Bachelor in Computer Science or equivalent</li>
<li>A minimum of one year work experience in the industry</li>
<li>Positive attitude and enthusiasm</li>
<li>Attention to details</li>
</ul>
<p><strong>Preferred skills:</strong></p>
<ul>
<li>Familiarity with Mac OS X and iPhone OS development</li>
<li>User-interface programming experience</li>
</ul>
</td>
</tr>
<tr>
<td width="127" valign="top"><strong>Contact</strong></td>
<td width="413" valign="top">To apply, please forward a cover letter and your resume (in Word or PDF format) in confidence to <a href="mailto:hr@dynamic-leap.com">hr@dynamic-leap.com</a>. Please specify the job ID <strong>SD10-03</strong> in the subject. Only the selected candidates will be contacted.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://dynamic-leap.com/software-developer-mobile2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginner iPhone Tutorial &#8211; Polygon (page 5)</title>
		<link>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-5/</link>
		<comments>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-5/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 10:02:28 +0000</pubDate>
		<dc:creator>Andrei Iancu</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[Core Graphics]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[start]]></category>

		<guid isPermaLink="false">http://dynamic-leap.com/?p=324</guid>
		<description><![CDATA[
&#60; Prev

Step 5 &#8211; Handling control events
Now we will write a few lines of code to update the number of vertices when the value of the slider changes.

Switch to XCode. Select PolygonViewController.m. Import PolgonView.m and add the following body to the &#8220;changeValue:&#8221; method:


#import "PolygonViewController.h"
#import "PolygonView.h"

@implementation PolygonViewController

- (IBAction)changeValue:(id)sender {
	NSUInteger vertices = (NSUInteger) _slider.value;

	_verticesLabel.text = [NSString stringWithFormat:@"%d", [...]]]></description>
			<content:encoded><![CDATA[<p></br><br />
<code><a href="../beginner-iphone-tutorial-polygon-page-4/">&lt; Prev</a></code><br />
<br /></br></p>
<h3>Step 5 &#8211; Handling control events</h3>
<p>Now we will write a few lines of code to update the number of vertices when the value of the slider changes.</p>
<ol>
<li>Switch to XCode. Select PolygonViewController.m. Import PolgonView.m and add the following body to the &#8220;<em>changeValue:</em>&#8221; method:<br />
<blockquote>
<pre>
#import "PolygonViewController.h"
<span style="color: #888800;">#import "PolygonView.h"</span>

@implementation PolygonViewController

- (IBAction)changeValue:(id)sender {
	<span style="color: #888800; padding-left: 30px;">NSUInteger vertices = (NSUInteger) _slider.value;

	_verticesLabel.text = [NSString stringWithFormat:@"%d", vertices];
	[_polygonView setVertices:vertices];</span>
}
</pre>
</blockquote>
<p>Build and run the application. Initially the screen looks like before, but try to drag the slider and the polygon appears! When the slider is moved the label changes numbers and the polygon changes its shape.
</li>
<li>Let&#8217;s make the polygon show from the start. We&#8217;ll use &#8220;<em>viewDidLoad</em>&#8221; to initialize the PolyView and the label with the initial value of the slide. Uncomment <em>viewDidLoad</em> and add the following highlighted line:<br />
<blockquote>
<pre>
- (void)viewDidLoad {
	<span style="padding-left: 30px;">[super viewDidLoad];
	<span style="color: #888800;">[self changeValue:nil];</span></span>
}
</pre>
</blockquote>
<p>Build and run the application. Now the application always starts with a pentagon.
</li>
<li>What if we want to save the number of vertices between runs? In this case we can use NSUserDefaults to persist the number of vertices. To do this we&#8217;ll add to &#8220;<em>changeValue:</em>&#8221; code to save the number of vertices:<br />
<blockquote>
<pre>
- (IBAction)changeValue:(id)sender {
	<span style="padding-left: 30px;">NSUInteger vertices = (NSUInteger) _slider.value;

	_verticesLabel.text = [NSString stringWithFormat:@"%d", vertices];
	[_polygonView setVertices:vertices];

	<span style="color: #888800;">NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
	[userDefaults setInteger:vertices forKey:@"vertices"];
	[userDefaults synchronize];</span></span>
}
</pre>
</blockquote>
<p>Now add to &#8220;<em>viewDidLoad</em>&#8221; code to restore the last saved value on startup:</p>
<blockquote>
<pre>
- (void)viewDidLoad {
	<span style="padding-left: 30px;">[super viewDidLoad];
	<span style="color: #888800;">NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
	NSUInteger vertices = [userDefaults integerForKey:@"vertices"];

	if (vertices != 0) {
		_slider.value = vertices;
	}</span>
	[self changeValue:nil];</span>
}
</pre>
</blockquote>
<p>Build and run. Change the slider position. Terminate the application and run it again. The application remembers the last position of the slider.</li>
</ol>
<p></br><br />
<code><a href="../beginner-iphone-tutorial-polygon-page-4/">&lt; Prev</a></code><br />
<script type="text/javascript"><!--
google_ad_client = "pub-4717305127551986";
/* Footer, created 2/22/10 */
google_ad_slot = "9400336562";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginner iPhone Tutorial – Polygon (page 4)</title>
		<link>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-4/</link>
		<comments>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-4/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 09:04:22 +0000</pubDate>
		<dc:creator>Andrei Iancu</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[Core Graphics]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[start]]></category>

		<guid isPermaLink="false">http://dynamic-leap.com/?p=297</guid>
		<description><![CDATA[
&#60; Prev Next &#62;

Step 4 &#8211; Connect the UI elements to data
Now that we placed and configured the UI elements in the nib file using Interface Builder, we need to connect them. The Model View Controller design pattern specifies that the controller classes are intermediaries between data and the UI elements. A controller can change [...]]]></description>
			<content:encoded><![CDATA[<p></br><br />
<code><a href="../beginner-iphone-tutorial-polygon-page-3/">&lt; Prev</a> <a href="../beginner-iphone-tutorial-polygon-page-5/">Next &gt;</a></code><br />
<br /></br></p>
<h3>Step 4 &#8211; Connect the UI elements to data</h3>
<p>Now that we placed and configured the UI elements in the nib file using Interface Builder, we need to connect them. The <a href="http://developer.apple.com/iphone/library/documentation/General/Conceptual/DevPedia-CocoaCore/MVC.html">Model View Controller</a> design pattern specifies that the controller classes are intermediaries between data and the UI elements. A controller can change the attributes of visible elements that are declared as &#8220;outlets&#8221; to reflect the value of the data (the model).  A controller can also modify the data as a result of a UI event through methods declared as &#8220;actions&#8221;.<br />
In our Polygon application the &#8220;data&#8221; is an integer storing the number of vertices.<br />
The &#8220;outlets&#8221; are:</p>
<ul>
<li>a label that displays the number of vertices as a string</li>
<li>the slider that positions its cursor to reflect the number of vertices</li>
<li>the polygon view that displays the polygon with the appropriate number of vertices</li>
</ul>
<p>The &#8220;action&#8221; method is called each time the slider&#8217;s value is changed.<br />
Let&#8217;s set this up.</p>
<ol>
<li>Switch to XCode, and select PolygonVieController.h. Add three member variables to the controller class, each one corresponding to a UI element, and a method definition to handle the slider control &#8220;value change&#8221; event. We will mark the variables with the keyword <em>IBOutlet</em>, and the method with <em>IBAction</em>. These two keywords that are understood by Interface Builder, so we can graphically connect later the variables with the corresponding UI elements. Add the following highlighted lines to your code.<br />
<blockquote>
<pre>
#import &lt;UIKit/UIKit.h&gt;

<span style="color: #888800;">@class PolygonView;</span>

@interface PolygonViewController : UIViewController {
	<span style="color: #888800; padding-left: 30px;">IBOutlet UISlider *_slider;
	IBOutlet UILabel  *_verticesLabel;
	IBOutlet PolygonView *_polygonView;</span>
}

<span style="color: #888800;">- (IBAction)changeValue:(id)sender;</span>

@end
</pre>
</blockquote>
<p>The line &#8220;<em>@class PolygonView;</em>&#8221; pre-declares the PolygonView class, so we do not need to import the whole PolygonView.h header file here. We will import PolygonView.h in the implementation file, where we actually make use of the PolygonView class methods.<br />
<strong>Note:</strong> Apple is recommending that we declare a property with a retain attribute for each <em>IBOutlet</em> instead of attaching the keyword to the member variable declarations themselves. This, however, complicates a little the code, so for the purposes of this tutorial I chose to ignore this recommendation. Production code, however, should be written obeying this rule.</p>
<p>Save the file.</li>
<li>Select the PolygonViewController.m file and add an implementation for the <em>changeValue</em> method:<br />
<blockquote>
<pre>
#import "PolygonViewController.h"

@implementation PolygonViewController

<span style="color: #888800;">- (IBAction)changeValue:(id)sender {
}</span>
</pre>
</blockquote>
<p>Save the file.</li>
<li>Switch back to Interface Builder, to PolygonViewController.xib. Select in the XIB window the File Owner. Select the &#8220;Connections&#8221; tab in the information window. You should see listed the 3 outlet variables ad the action. If not make sure you save PolygonViewController.h and redo this step. Drag and drop from the circle at the right of each of the outlets to the corresponding UI element in the view window.<br />
<a href="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure7.png" rel="lightbox[297]"><img src="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure7.png" alt="" title="Figure7" width="476" height="415" class="aligncenter size-full wp-image-310" /></a><br />
You will find that you can drag from an outlet only to UI elements of corresponding type. Make sure to drag from the outlet &#8220;_verticesLabel&#8221; to the label with the text &#8220;0&#8243;, and not to the other label.<br />
To connect the action drag and drop from &#8220;<em>changeValue:</em>&#8221; to the slider. When you drop a list of events will pop up. Choose the event &#8220;<em>Value Changed</em>&#8220;. <a href="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure8.png" rel="lightbox[297]"><img src="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure8.png" alt="" title="Figure8" width="240" height="266" class="aligncenter size-full wp-image-311" /></a><br />
At the end the &#8220;Connections&#8221; tab of the information window should look like this:<br />
<a href="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure9.png" rel="lightbox[297]"><img src="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure9.png" alt="" title="Figure9" width="215" height="196" class="aligncenter size-full wp-image-312" /></a><br />
Save the nib file.
</li>
</ol>
<p>Build and run the application. You should not get any compilation errors, but the application still does not do much. In the next step we&#8217;ll implement the action method.<br />
<br /></br><br />
<code><a href="../beginner-iphone-tutorial-polygon-page-3/">&lt; Prev</a> <a href="../beginner-iphone-tutorial-polygon-page-5/">Next &gt;</a></code><br />
<script type="text/javascript"><!--
google_ad_client = "pub-4717305127551986";
/* Footer, created 2/22/10 */
google_ad_slot = "9400336562";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginner iPhone Tutorial – Polygon (page 3)</title>
		<link>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-3/</link>
		<comments>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-3/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 22:22:37 +0000</pubDate>
		<dc:creator>Andrei Iancu</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[Core Graphics]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[start]]></category>

		<guid isPermaLink="false">http://dynamic-leap.com/?p=262</guid>
		<description><![CDATA[
&#60; Prev Next &#62;

Step 3 &#8211; Create the screen layout, and use PolygonView
We can create and edit graphically the UI for our iPhone application using Interface Builder. This tool creates and edits files with the extension xib. Note: The old extension for the resource files on Mac was nib, and this extension name is still [...]]]></description>
			<content:encoded><![CDATA[<p></br><br />
<code><a href="../beginner-iphone-tutorial-polygon-page-2/">&lt; Prev</a> <a href="../beginner-iphone-tutorial-polygon-page-4/">Next &gt;</a></code><br />
<br /></br></p>
<h3>Step 3 &#8211; Create the screen layout, and use PolygonView</h3>
<p>We can create and edit graphically the UI for our iPhone application using Interface Builder. This tool creates and edits files with the extension xib. <strong>Note:</strong> The old extension for the resource files on Mac was <em>nib</em>, and this extension name is still used for the compiled xib files. The API and the documentation still refer to those resource files as nib files. We will also refer to them as nib files despite their xib extension.</p>
<ol>
<li>In the &#8220;Resources&#8221; group in Groups &amp; Files, double-click on the file PolygonViewController.xib. Interface Builder will launch shortly (it takes a little bit before starting up for the first time). Interface Builder will present you with 4 windows:
<ul>
<li><strong>The main nib window</strong> &#8211; showing all the objects in the nib, both UI elements and controllers. This type of window is one per opened nib file. Make sure to choose the &#8220;list&#8221; view mode on the toolbar.<a href="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure3.png" rel="lightbox[262]"><img src="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure3.png" alt="" title="Figure3" width="260" height="415" class="aligncenter size-full wp-image-270" /></a></li>
<li><strong>The view window</strong> &#8211; showing the view object and its children UI elements, the way they would show on the screen. For each nib we may have a number of this kind of windows, depending of how many UI objects we have at the top level of the nib hierarchy. For now it is only a gray rectangle the size of the iPhone screen.</li>
<li><strong>The information window</strong> &#8211; there is only one such window, and it has 4 tabs that show different aspects of the currently selected item in one of the first two kinds of windows (the nib window or the view). It can show attributes, connections, size, or identity information, depending on what tab is selected on the top bar.</li>
<li><strong>The library window</strong> &#8211; like the information window, there is only one such window. This window allows access to predefined and custom objects (controllers or UI elements) that can be dragged and dropped on the nib windows, or on the view windows.</li>
</ul>
</li>
<li>Drag and drop two &#8220;Label&#8221; objects from the library window to the view window. Double-click the label elements one at a time and edit the text. Make one say &#8220;Number of vertices:&#8221; and the other &#8220;0&#8243;. Also drag and drop a &#8220;Slider&#8221; object and a &#8220;View&#8221; object. Rearange and resize the objects to look like this:<a href="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure4.png" rel="lightbox[262]"><img src="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure4.png" alt="" title="Figure4" width="240" height="377" class="aligncenter size-full wp-image-277" /></a>Save the nib file.</li>
<li>Now, select the slider in the view window and choose the attributes tab in the information window. Change the field values in the Values section as follows: Minimum = 3, Maximum = 20, and Initial = 5. The info window should look like this.<a href="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure5.png" rel="lightbox[262]"><img src="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure5.png" alt="" title="Figure5" width="215" height="211" class="aligncenter size-full wp-image-279" /></a>Save the nib file.</li>
<li>Select the view object you just dragged onto the main view window. In the information window select the identity tab. In the &#8220;Class&#8221; field select PolygonView from the drop down. <a href="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure6.png" rel="lightbox[262]"><img src="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure6.png" alt="" title="Figure6" width="215" height="151" class="aligncenter size-full wp-image-289" /></a>Save the nib file.</li>
</ol>
<p>Build and run the application. You should get no errors, and the screen should show now the UI elements. In the next step we will connect the UI elements using the controller class.<br />
<br /></br><br />
<code><a href="../beginner-iphone-tutorial-polygon-page-2/">&lt; Prev</a> <a href="../beginner-iphone-tutorial-polygon-page-4/">Next &gt;</a></code><br />
<script type="text/javascript"><!--
google_ad_client = "pub-4717305127551986";
/* Footer, created 2/22/10 */
google_ad_slot = "9400336562";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginner iPhone Tutorial &#8211; Polygon (page 2)</title>
		<link>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-2/</link>
		<comments>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-2/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 23:13:22 +0000</pubDate>
		<dc:creator>Andrei Iancu</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[Core Graphics]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[start]]></category>

		<guid isPermaLink="false">http://dynamic-leap.com/?p=225</guid>
		<description><![CDATA[
&#60; Prev Next &#62;

Step 2 &#8211; Create a custom view to display the polygon
To create a custom view we need to create a new Objective C class derived from UIView and implement its drawing method &#8220;drawRect:&#8221; to make it draw a polygon. Here is what we need to:

Select the &#8220;Classes&#8221; group in Groups &#38; Files. [...]]]></description>
			<content:encoded><![CDATA[<p></br><br />
<code><a href="../beginner-iphone-tutorial-polygon/">&lt; Prev</a> <a href="../beginner-iphone-tutorial-polygon-page-3/">Next &gt;</a></code><br />
<br /></br></p>
<h3>Step 2 &#8211; Create a custom view to display the polygon</h3>
<p>To create a custom view we need to create a new Objective C class derived from UIView and implement its drawing method &#8220;<em>drawRect:</em>&#8221; to make it draw a polygon. Here is what we need to:</p>
<ol>
<li>Select the &#8220;Classes&#8221; group in Groups &amp; Files. Choose the menu &#8220;File/New File&#8230;&#8221;</li>
<li>From the &#8220;Cocoa Touch Class&#8221; group of templates select the &#8220;Objective-C class&#8221; template, and set the &#8220;Subclass of&#8221; drop down to UIView <a href="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure2.png" rel="lightbox[225]"><img class="aligncenter size-full wp-image-203" title="Figure2" src="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure2.png" alt="" width="580" height="355" /></a></li>
<li>Click &#8220;Next&#8221; and set the &#8220;File Name&#8221; to PolygonView.m</li>
<li>Edit the header file PolygonView.h that we just created to add a member variable called _vertices, and a method to set the number of vertices. This will tell the view how many vertices it needs to draw.<br />
<blockquote>
<pre>#import &lt;UIKit/UIKit.h&gt;

@interface PolygonView : UIView {
<span style="color: #888800; padding-left: 30px;">NSUInteger _vertices;</span>
}

<span style="color: #888800;">- (void)setVertices:(NSUInteger) vertices;</span>

@end</pre>
</blockquote>
<p>Note that I use the underscore notation in front of my member variables. This helps me distinguish member variables from local variables or arguments in method implementations. This notation is also <a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/ModelObjects/Articles/moIntegrating.html" target="_blank"> KVC/KVO compliant</a>.</li>
<li>Switch to the file PolygonView.m and add an implementation for the method <em>drawRect:</em><br />
<blockquote><pre>
- (void)drawRect:(CGRect)rect {
<span style="color: #888800; padding-left: 30px;">CGFloat radius = self.bounds.size.width/2.5;

	if (radius &gt; self.bounds.size.height/2.5) {
		<span style="padding-left: 30px;">radius = self.bounds.size.height/2.5;</span>
	}

	CGFloat arc = M_PI * 2.0 / _vertices;
	CGContextRef context = UIGraphicsGetCurrentContext();
	CGContextBeginPath(context);
	CGContextMoveToPoint(context, self.bounds.size.width/2, self.bounds.size.height/2 - radius);

	for (NSUInteger i = 1; i &lt; _vertices; i++) {
		<span style="padding-left: 30px;">CGContextAddLineToPoint(context, self.bounds.size.width/2 + radius * sin(arc * i), self.bounds.size.height/2 - radius * cos(arc * i));</span>
	}

	CGContextClosePath(context);
	CGContextSetLineWidth(context, 5.0);
	CGContextStrokePath(context); </span>
}
</pre>
</blockquote>
<p>This method is executed whenever the OS decides that the view class needs to draw its UI on the screen. We are obtaining the current graphics context (the virtual &#8220;canvas&#8221; on which we draw), and we start building a drawing path (a collection of drawing commands). We including first a moving command for the &#8220;current point&#8221; (our virtual drawing cursor) to the location of out top vertex, and then we start adding line drawing commands to the current path from one vertex to the next until we&#8217;re done. At the end we close the open path (to create a closed polygon), we set the line width to 5, and we draw the lines in the path on the graphics context. To draw a solid polygon instead of only a polygon outline, you could replace the <em>CGContextStrokePath</em> call with <em>CGContextFillPath</em>.</li>
<li>We also need to add an implementation for the accessory method <em>setVertices</em> we declared in the header file<br />
<blockquote>
<pre>
<span style="color: #888800;">- (void)setVertices:(NSUInteger)vertices {
	<span style="padding-left: 30px;">_vertices = vertices;
	[self setNeedsDisplay];</span>
}</span>
</pre>
</blockquote>
<p>In this method, after we set the value of the <em>_vertices</em> member variable, we send a message to the OS to declare the currently displayed drawing invalid. If our view is visible the screen, the OS will call at its soonest opportunity our <em>drawRect</em> method so we redraw the UI correctly.</p>
<p>With this we are done implementing our custom UIView class.</li>
</ol>
<p>Build and project. You should get no errors. If you run the application you will see no changes to the UI. In the next step we will add some UI elements to the main view.<br />
<br /></br><br />
<code><a href="../beginner-iphone-tutorial-polygon/">&lt; Prev</a> <a href="../beginner-iphone-tutorial-polygon-page-3/">Next &gt;</a></code><br />
<script type="text/javascript"><!--
google_ad_client = "pub-4717305127551986";
/* Footer, created 2/22/10 */
google_ad_slot = "9400336562";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://dynamic-leap.com/beginner-iphone-tutorial-polygon-page-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginner iPhone Tutorial &#8211; Polygon</title>
		<link>http://dynamic-leap.com/beginner-iphone-tutorial-polygon/</link>
		<comments>http://dynamic-leap.com/beginner-iphone-tutorial-polygon/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 23:12:40 +0000</pubDate>
		<dc:creator>Andrei Iancu</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[Core Graphics]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[start]]></category>

		<guid isPermaLink="false">http://dynamic-leap.com/?p=170</guid>
		<description><![CDATA[
Next &#62;
I decided to post a tutorial I am doing during the first class at the iPhone course I am teaching in Vancouver. This tutorial is meant to quickly introduce novices to the iPhone SDK development tools, showcase some fundamental design patterns and demonstrate how easy it is to get started developing for Apple&#8217;s iPhone, iPod Touch [...]]]></description>
			<content:encoded><![CDATA[<p></br><br />
<code><a href="../beginner-iphone-tutorial-polygon-page-2/">Next &gt;</a></code></p>
<p>I decided to post a tutorial I am doing during the first class at the <a title="BCIT iPhone Programming Course" href="http://www.bcit.ca/study/courses/mdia2652" target="_blank">iPhone course</a> I am teaching in Vancouver. This tutorial is meant to quickly introduce novices to the iPhone SDK development tools, showcase some fundamental design patterns and demonstrate how easy it is to get started developing for Apple&#8217;s iPhone, iPod Touch and the iPad. I will also publish specific iPad application development tutorials as soon as the iPhone 3.2 SDK becomes public, and the nondisclosure agreement with Apple permits.</p>
<h3>What will you learn?</h3>
<ul>
<li><strong>Tools:</strong> how to use <em>XCode</em> to create a new iPhone application,  how to add a new class file and how to create your own view class. Using <em>Interface Builder</em>: drag and drop, inspector tabs, custom classes, connecting graphically objects, outlets and actions.</li>
<li><strong>Programming:</strong> practical examples of implementing the Model View Controller design pattern, outlets and actions, member variable naming conventions, forward class declaration, deriving classes, and overriding methods.</li>
<li><strong>Frameworks:</strong> <em>UIKit</em> concepts: creating a custom UIView by overriding drawRect, and the use of needsDisplay and needsLayout. <em>Core Graphics</em> concepts: context, path, current position, adding to path, stroke, fill.</li>
</ul>
<h3>Prerequisites</h3>
<ul>
<li>You need an Intel based Mac. Unfortunately iPhone development cannot be done on a PC or on a Linux machine.</li>
<li>You need to have at least some basic programming experience, preferably in an object oriented language. To understand Objective C is useful to read the language guide <a title="The Objective C Programming Guide" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/ObjectiveC/index.html" target="_blank">here</a>.</li>
<li>Download and install the latest iPhone SDK from <a href="http://developer.apple.com/iphone/program/download.html" target="_blank">here</a>. For this you will need to  become a Registered iPhone Developer with Apple&#8217;s iPhone Dev Center. <strong>Note:</strong> The SDK is a free download for any registered iPhone developer, and you do not need to join (yet) the iPhone Developer Program which costs $99/year. You may want to join the iPhone Developer Program later when you decide to try your applications on real devices (iPhone or iPod Touch), but for now you can try everything on the iPhone Simulator which runs on your Mac.</li>
</ul>
<h1>Tutorial</h1>
<p>We will create a small application with a custom made view that displays a regular polygon with a variable number of vertices (between 3 and 20). The application will also display the number of vertices, and will allow the user to change the number of vertices by moving a slider control on the screen.</p>
<h3>Step 1 &#8211; Create a new project called Polygon</h3>
<ol>
<li>Make sure that the latest iPhone SDK is installed, and launch XCode.</li>
<li>Select the menu &#8220;File/New Project&#8230;&#8221;.</li>
<li>On the left column of the New Project dialog select &#8220;Application&#8221; under the &#8220;iPhone OS&#8221; section title. In the right window select &#8220;View-based Application&#8221;. Press &#8220;Choose&#8230;&#8221;, type in &#8220;Polygon&#8221; in the &#8220;Save As&#8221; field of the popup box, and click Save.</li>
</ol>
<p><strong>Note: </strong>Use the exact spelling and case for the project name, so you can just copy and paste code later in the tutorial.</p>
<ol><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline;"><img class="aligncenter size-full wp-image-191" title="New Project" src="http://dynamic-leap.com/wp-content/uploads/2010/01/Figure1.png" alt="" width="520" height="504" /></span></ol>
<p>Build and run the application. You should get no errors and the screen should show a gray view taking over all the screen except for the status bar. In the next step we will implement a custom view class that can draw a polygon on the screen.<br />
<br /></br><br />
<code><a href="../beginner-iphone-tutorial-polygon-page-2/">Next &gt;</a></code></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4717305127551986";
/* Footer, created 2/22/10 */
google_ad_slot = "9400336562";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://dynamic-leap.com/beginner-iphone-tutorial-polygon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Training</title>
		<link>http://dynamic-leap.com/training/</link>
		<comments>http://dynamic-leap.com/training/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 06:23:08 +0000</pubDate>
		<dc:creator>kds</dc:creator>
				<category><![CDATA[Services]]></category>

		<guid isPermaLink="false">http://dynamic-leap.com/?p=98</guid>
		<description><![CDATA[Dynamic Leap is providing iPhone and iPad development training to companies that wish to update their own developers rather than hire specialized contractors. The training is provided as a 5 days - 6 hours/day on-site and hands-on intensive course. Contact us for details and pricing.]]></description>
			<content:encoded><![CDATA[<p>Dynamic Leap is providing iPhone and iPad development training to companies that wish to update their own developers rather than hire specialized contractors. The training is provided as a 5 days &#8211; 6 hours/day on-site and hands-on intensive course. Contact us for details and pricing.<br />
<strong>CoreHealth Technologies testimonial</strong>:<br />
&#8220;I felt that your knowledge of the material was very good and I appreciated that you didn’t try to fake your way through stuff that you weren’t sure of.&#8221;<br />
<strong>and</strong><br />
&#8220;Andrei provided a very flexible and well targeted curriculum to suit our needs.  He was able to provide information about key features that will allow us to progress our product offerings.&#8221;<br />
Jeff Van Dyk, CTO, CoreHealth Technologies Inc.</p>
]]></content:encoded>
			<wfw:commentRss>http://dynamic-leap.com/training/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Development</title>
		<link>http://dynamic-leap.com/software-development-2/</link>
		<comments>http://dynamic-leap.com/software-development-2/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 06:22:31 +0000</pubDate>
		<dc:creator>kds</dc:creator>
				<category><![CDATA[Services]]></category>

		<guid isPermaLink="false">http://dynamic-leap.com/?p=96</guid>
		<description><![CDATA[Dynamic Leap is providing software development services for mobile devices like the iPhone and the iPad to customers like Cellmap, Wantsa, ConQuer Mobile and others. Notably in Apple’s AppStore, Dynamic Leap performed development, under subcontract, on Cellmap’s iPhone collaborations with Canpages - the “Canpages” and “My Nearest” iPhone applications.]]></description>
			<content:encoded><![CDATA[<p>Dynamic Leap is providing software development services for mobile devices like the iPhone and the iPad to customers like Cellmap, Wantsa, ConQuer Mobile and others. Notably in Apple’s AppStore, Dynamic Leap performed development, under subcontract, on Cellmap’s iPhone collaborations with Canpages &#8211; the “Canpages” and “My Nearest” iPhone applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://dynamic-leap.com/software-development-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
