<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>OnRails.org: iPhone SDK - first 5 minutes.</title>
    <link>http://onrails.org/articles/2008/03/07/iphone-sdk-first-5-minutes</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Ruby On Rails and related matters.</description>
    <item>
      <title>iPhone SDK - first 5 minutes.</title>
      <description>&lt;p&gt;Off course I couldn&amp;#8217;t resist, I had to give it a try. The sdk is a whopping 2GB download and 5.6 Gb install. It installs all the developers tools, java, gcc4.2, WebObjects, the kitchen sink. Upon successful installation the system needs to be restarted.&lt;/p&gt;


Start XCode and select &amp;#8216;New Project&amp;#8230;&amp;#8217; from the File menu.
You can then select from 3 type of iPhone Applications 
&lt;div style="text-align:center;"&gt;&lt;img src="http://onrails.org/files/20080307_1_iphone_projects.gif" alt="20080307_1_iphone_projects.gif" border="0" width="455" height="103" /&gt;&lt;/div&gt;

	&lt;p&gt;Let&amp;#8217;s try the Cocoa Touch List and I name my test project TimeList.&lt;/p&gt;


This creates a standard XCode project:
&lt;div style="text-align:center;"&gt;&lt;img src="http://onrails.org/files/20080307_2_XCodeProject.jpg" alt="20080307_2_XCodeProject.jpg" border="0" width="447" height="335" /&gt;&lt;/div&gt;

	&lt;p&gt;I clicked &amp;#8220;Build and Go&amp;#8221;...the application is compiled and linked after 20 seconds got an emulate iPhone with the TimeList app visible:&lt;/p&gt;


&lt;div style="text-align:center;"&gt;&lt;img src="http://onrails.org/files/20080307_3_iPhoneHome.jpg" alt="20080307_3_iPhoneHome.jpg" border="0" width="231" height="445" /&gt;&lt;/div&gt; 

	&lt;p&gt;Clicking on it we get a pre-populated list of timezones which behaves just like an iPhone:&lt;/p&gt;


&lt;div style="text-align:center;"&gt;&lt;img src="http://onrails.org/files/20080307_4_TimeList.jpg" alt="20080307_4_TimeList.jpg" border="0" width="231" height="445" /&gt;&lt;/div&gt;

	&lt;p&gt;Note the emulator application is called Aspen Simulator, it has a &amp;#8216;Hardware&amp;#8217; menu that should allow to rotate the UI but that doesn&amp;#8217;t seem to work. The emulator really feels like an iPhone, all the finger gestures can be done with the mouse and the UI behaves like an iPhone. Pretty cool.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s look at the TimeListAppDelegate generated code:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;//
//  TimeListAppDelegate.m
//  TimeList
//
//  Created by Daniel Wanja on 3/7/08.
//  Copyright __MyCompanyName__ 2008. All rights reserved.
//

#import &amp;quot;TimeListAppDelegate.h&amp;quot;

@implementation TimeListAppDelegate

@synthesize window;
@synthesize tableView;

- init {
    if (self = [super init]) {
        // Your initialization code here
    }
    return self;
}

- (void)applicationDidFinishLaunching:(UIApplication *)application {
    // Create window
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];

    // Set up table view
    tableView = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] style:UITableViewStylePlain];
    tableView.delegate = self;
    tableView.dataSource = self;

    // Show the window with table view
    [window addSubview:tableView];
    [window makeKeyAndVisible];
    [tableView reloadData];
}

- (void)dealloc {
    [tableView release];
    [window release];
    [super dealloc];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [[NSTimeZone  knownTimeZoneNames] count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath withAvailableCell:(UITableViewCell *)availableCell {
    UISimpleTableViewCell *cell = nil;
    if (availableCell != nil) {
        cell = (UISimpleTableViewCell *)availableCell;
    } else {
        CGRect frame = CGRectMake(0, 0, 300, 44);
        cell = [[[UISimpleTableViewCell alloc] initWithFrame:frame] autorelease];
    }
    cell.text = [[NSTimeZone knownTimeZoneNames] objectAtIndex:[indexPath row]];
    return cell;
}

@end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Looks like I have lots to read about before I can start changing that application. From what I can decipher once the application is initialized a UITableView is created and the delegate of the table view becomes the TimeListAppDelegate whish implements the numberOfRowsInSection and  cellForRowAtIndexPath methods which uses the NSTimeZone knowTimeZonesNames as data source.&lt;/p&gt;


	&lt;p&gt;That was my first 5 minutes with the &lt;span class="caps"&gt;SDK&lt;/span&gt;. More to follow&amp;#8230;now I have to go back to work :-( Next thing I will try out is the Interface Builder&amp;#8230;stay tuned.&lt;/p&gt;


	&lt;p&gt;Enjoy!
Daniel.&lt;/p&gt;</description>
      <pubDate>Fri, 07 Mar 2008 16:16:03 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:7a0c973a-8f33-431e-b0d3-37220e78ec95</guid>
      <author>Daniel Wanja</author>
      <link>http://onrails.org/articles/2008/03/07/iphone-sdk-first-5-minutes</link>
    </item>
    <item>
      <title>"iPhone SDK - first 5 minutes." by Roy</title>
      <description>&lt;p&gt;I have never even seen a Mac ..
From the source code it is obvious it is not C nor C++.&lt;/p&gt;


	&lt;p&gt;1. Is it Objective-C?
2. Are there C or C++ APIs in the SDK?&lt;/p&gt;


	&lt;p&gt;Thanks,
Roy&lt;/p&gt;</description>
      <pubDate>Thu, 10 Apr 2008 10:20:13 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:64d8f1fc-1602-474c-8440-7f74e3636097</guid>
      <link>http://onrails.org/articles/2008/03/07/iphone-sdk-first-5-minutes#comment-3460</link>
    </item>
    <item>
      <title>"iPhone SDK - first 5 minutes." by Derek Fisher</title>
      <description>&lt;p&gt;Yeah, looks like you have lots to read about before :) All in all, quite interesting&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Mon, 17 Mar 2008 16:30:34 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:1526e7c1-7bbc-49e2-bdf0-35039948e911</guid>
      <link>http://onrails.org/articles/2008/03/07/iphone-sdk-first-5-minutes#comment-3400</link>
    </item>
    <item>
      <title>"iPhone SDK - first 5 minutes." by KANG Ghee Keong</title>
      <description>&lt;p&gt;Well, a blank new application do not look so daunting.  Try it.  Easy to build, but yes I&amp;#8217;m also working on how to do a GUI.  Tough without an interface builder.  Back to handcoding fun days!&lt;/p&gt;</description>
      <pubDate>Mon, 17 Mar 2008 10:41:03 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:b353ddf8-4342-403c-92e0-c116454b2c94</guid>
      <link>http://onrails.org/articles/2008/03/07/iphone-sdk-first-5-minutes#comment-3399</link>
    </item>
    <item>
      <title>"iPhone SDK - first 5 minutes." by JJ</title>
      <description>&lt;p&gt;The download time and take up of memory space should be worth it! When this was announced I was just so excited. but I am still downloading now .&lt;/p&gt;</description>
      <pubDate>Sat, 08 Mar 2008 01:01:23 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:b4c0531f-ebd2-421c-9697-547e691e3810</guid>
      <link>http://onrails.org/articles/2008/03/07/iphone-sdk-first-5-minutes#comment-3375</link>
    </item>
    <item>
      <title>"iPhone SDK - first 5 minutes." by fake</title>
      <description>&lt;p&gt;save the time&amp;#8230; the interface builder is not included yet. it&amp;#8217;s &amp;#8220;coming soon&amp;#8221;. i was looking for it, too ;-)&lt;/p&gt;</description>
      <pubDate>Fri, 07 Mar 2008 19:40:12 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:7d7005a9-bdc3-4137-94bd-0073b62583c9</guid>
      <link>http://onrails.org/articles/2008/03/07/iphone-sdk-first-5-minutes#comment-3374</link>
    </item>
    <item>
      <title>"iPhone SDK - first 5 minutes." by Daniel Wanja</title>
      <description>&lt;p&gt;Well, I wouldn&amp;#8217;t release anything If would have signed an NDA, but I don&amp;#8217;t think there was any NDA when downloading the Free SDK. The name of the SDK may be missleading, it&amp;#8217;s free and available for anyone to download who has an appleid, so I don&amp;#8217;t believe  am divulging any confidential information in the above blog entry. Please correct me if I am wrong. Furthermore there is nothing in the above blog entry that hasn&amp;#8217;t been made publicly available during yesterdays &lt;a href="http://events.apple.com.edgesuite.net/rtp20e92/event/index.html" rel="nofollow"&gt;keynote &lt;/a&gt;. I&amp;#8217;ll make sure to go through all the fine print before releasing any further information. But the SDK really Rocks! Tons of example,  awesome documentation. iPhone development looks to be really fun.&lt;/p&gt;</description>
      <pubDate>Fri, 07 Mar 2008 19:29:23 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:02ecd17b-ae7e-472f-a54c-5276c0a18253</guid>
      <link>http://onrails.org/articles/2008/03/07/iphone-sdk-first-5-minutes#comment-3373</link>
    </item>
    <item>
      <title>"iPhone SDK - first 5 minutes." by Concerned Netizen</title>
      <description>&lt;p&gt;Please don’t forget that access to the iPhone SDK is covered by an NDA which prohibits publicly posting details about the SDK itself.&lt;/p&gt;</description>
      <pubDate>Fri, 07 Mar 2008 19:08:16 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:da4d57e2-b731-470c-981d-2d6ff735fcf3</guid>
      <link>http://onrails.org/articles/2008/03/07/iphone-sdk-first-5-minutes#comment-3371</link>
    </item>
    <item>
      <title>"iPhone SDK - first 5 minutes." by Mike</title>
      <description>&lt;p&gt;It would be awesome if you could build iPhone apps with MacRuby!&lt;/p&gt;</description>
      <pubDate>Fri, 07 Mar 2008 18:21:52 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:933e32ad-b4ff-4a82-89b4-6efa4779f8f7</guid>
      <link>http://onrails.org/articles/2008/03/07/iphone-sdk-first-5-minutes#comment-3370</link>
    </item>
  </channel>
</rss>
