<?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>ScratchMyTail.com &#187; iPhone</title>
	<atom:link href="http://www.scratchmytail.com/category/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scratchmytail.com</link>
	<description>My little tech blog</description>
	<lastBuildDate>Sat, 29 May 2010 15:15:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>My first iPhone application</title>
		<link>http://www.scratchmytail.com/2010/03/13/my-first-iphone-application/</link>
		<comments>http://www.scratchmytail.com/2010/03/13/my-first-iphone-application/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 18:15:45 +0000</pubDate>
		<dc:creator>ScratchMyTail</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[tv-lista]]></category>

		<guid isPermaLink="false">http://www.scratchmytail.com/?p=244</guid>
		<description><![CDATA[My first application developed for the iPhone is now available in AppStore. Read more about the application here. You can also take a closer look in iTunes via this link.]]></description>
			<content:encoded><![CDATA[<p>My first application developed for the iPhone is now available in AppStore. Read more about the application <a href="http://www.scratchmytail.com/tvlista">here</a>. You can also take a closer look in iTunes via this <a href="http://appsto.re/TV-Lista">link</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scratchmytail.com/2010/03/13/my-first-iphone-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Storing custom objects to disk on the iPhone</title>
		<link>http://www.scratchmytail.com/2009/11/06/storing-custom-objects-to-disk-on-the-iphone/</link>
		<comments>http://www.scratchmytail.com/2009/11/06/storing-custom-objects-to-disk-on-the-iphone/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 13:18:13 +0000</pubDate>
		<dc:creator>ScratchMyTail</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[load array]]></category>
		<category><![CDATA[NSCoder]]></category>
		<category><![CDATA[NSCoding]]></category>
		<category><![CDATA[save array]]></category>
		<category><![CDATA[serialize objects]]></category>

		<guid isPermaLink="false">http://www.scratchmytail.com/?p=181</guid>
		<description><![CDATA[In this tutorial I will show you how you can store custom objects to disk on the iPhone. I will create a simple array containing custom Person objects. Then I will store the array to disk and afterwards load the array. The clue is to implement the NSCoding protocol in the Person class, or the [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I will show you how you can store custom objects to disk on the iPhone. I will create a simple array containing custom Person objects. Then I will store the array to disk and afterwards load the array. The clue is to implement the NSCoding protocol in the Person class, or the classes of the objects that we have in our array or dictionary.  It&#8217;s quite simple actually.</p>
<p><span id="more-181"></span></p>
<h3>Person.h</h3>
<p>In the code below we define the interface of the Person class. Notice the NSCoding protocol in the interface header.</p>
<pre>
<blockquote>
@interface Person : NSObject &lt;NSCoding&gt;
{
     NSString *firstName;
     NSString *secondName;
     NSString *phone;
}
@property (nonatomic, retain)NSString *firstName;
@property (nonatomic, retain)NSString *lastName;
@property (nonatomic, retain)NSString *phone;</blockquote>
</pre>
<h3>Person.m</h3>
<p>In the code below we can see the person implementation. Notice the implementation of the NSCoding protocol. We have to implement two methods, <em>encodeWithCoder</em> and <em>initWithCoder</em>. We tell the NSCoding protocol that we want to decode and encode all of the person&#8217;s members. We give the objects keys in the first method so that we are able to find them again later when we decode.</p>
<pre>
<blockquote>
@implementation Person
@synthesize firstName, secondName, phone;

- (void)encodeWithCoder:(NSCoder *)encoder {
    [encoder encodeObject:firstName forKey:@"firstName"];
    [encoder encodeObject:lastName forKey:@"lastName"];
    [encoder encodeObject:phone forKey:@"phone"];
}

- (id)initWithCoder:(NSCoder *)decoder {
    if (self = [super init]) {
        self.firstName = [decoder decodeObjectForKey:@"firstName"];
	self.lastName = [decoder decodeObjectForKey:@"lastName"];
	self.phone = [decoder decodeObjectForKey:@"phone"];
    }
    return self;
}</blockquote>
</pre>
<h3>Saving and loading an array</h3>
<p>In the code below we populate an array with two person objects, then we save the array to disk and afterwards load it.</p>
<pre>
<blockquote>
// Create two person objects
Person *person1 = [[Person alloc] init];
person1.firstName = @"Peter";
person1.lastName = @"Peterson";
person1.phone = @"12345678";

Person *person2 = [[Person alloc] init];
person2.firstName = @"Andrea";
person2.lastName = @"Peterson";
person2.phone = @"12345687";

// Put them into an array
NSArray *array = [[NSArray alloc] initWithObjects:person1, person2, nil];

// Save the array
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
                                                     NSUserDomainMask, YES);
NSString *docDir = [paths objectAtIndex:0];
NSString *fullFileName = [NSString stringWithFormat:@"%@/ourArray", docDir];
[NSKeyedArchiver archiveRootObject:array toFile:fullFileName];

// Load the array
NSMutableArray *arrayFromDisk = [NSKeyedUnarchiver
                                 unarchiveObjectWithFile:fullFileName];</blockquote>
</pre>
<h3>Conclusion</h3>
<p>Follow this tutorial if you want to save your arrays or dictionaries to disk for later use. Following this method is very simple and it actually works. I&#8217;ve read alot of different tutorials on the web, most of them suggest storing your objects either as .plist files or by using SQLite. I think following this method is both easy and efficient. Read more about the NSCoding protocol <a title="NSCoding" href="http://developer.apple.com/mac/library/documentation/cocoa/Reference/Foundation/Protocols/NSCoding_Protocol/Reference/Reference.html">here</a>.</p>
<p>EDIT: There was a bug in my code. fullFileName was missing %@/ in the stringWithFormat message.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scratchmytail.com/2009/11/06/storing-custom-objects-to-disk-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting developing apps for the iPhone</title>
		<link>http://www.scratchmytail.com/2009/03/07/starting-developing-apps-for-the-iphone/</link>
		<comments>http://www.scratchmytail.com/2009/03/07/starting-developing-apps-for-the-iphone/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 14:37:07 +0000</pubDate>
		<dc:creator>ScratchMyTail</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.scratchmytail.com/?p=144</guid>
		<description><![CDATA[Today i finally received my first iPhone development book. The book is titled &#8220;Beginning iPhone Development: Exploring the iPhone SDK&#8220;. The book is written by Dave Mark and Jeff LaMarche. Both have alot experience with Cocoa and Objective-C, so I think this is a good book. I gave the university library a visit too where [...]]]></description>
			<content:encoded><![CDATA[<p>Today i finally received my first iPhone development book. The book is titled &#8220;<a href="http://www.amazon.com/Beginning-iPhone-Development-Exploring-Professional/dp/1430216263/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1236436515&amp;sr=8-1">Beginning iPhone Development: Exploring the iPhone SDK</a>&#8220;. The book is written by Dave Mark and Jeff LaMarche. Both have alot experience with Cocoa and Objective-C, so I think this is a good book. I gave the university library a visit too where I found a Objective-C book,  so no I&#8217;m well prepared for creating the next killer app!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scratchmytail.com/2009/03/07/starting-developing-apps-for-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Palm Pre introduced at CES</title>
		<link>http://www.scratchmytail.com/2009/01/14/palm-pre-introduced-at-ces/</link>
		<comments>http://www.scratchmytail.com/2009/01/14/palm-pre-introduced-at-ces/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 18:46:57 +0000</pubDate>
		<dc:creator>ScratchMyTail</dc:creator>
				<category><![CDATA[Palm]]></category>
		<category><![CDATA[Palm Pre]]></category>
		<category><![CDATA[Touch Phone]]></category>
		<category><![CDATA[WebOS]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.scratchmytail.com/?p=67</guid>
		<description><![CDATA[The Palm Pre was announced earlier this month at CES (Consumer Electronics Show). The Palm Pre is a smartphone with touchscreen and a qwerty-pulldown keyboard. I would say this is the first real iPhone competitor. The Palm Pre uses what is called the webOS. With this OS you can build custom applications for the device [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="Palm Pree" src="http://www.scratchmytail.com/bilder/pre_01.png" alt="" width="515" height="430" /></p>
<p>The Palm Pre was announced earlier this month at CES (Consumer Electronics Show). The Palm Pre is a smartphone with touchscreen and a qwerty-pulldown keyboard. I would say this is the first real iPhone competitor. The Palm Pre uses what is called the webOS. With this OS you can build custom applications for the device using only HTML, CSS, XML and JavaScript. This is very practical, you do not have to learn any new languages, that is, if you know the basics of web-programming. Compared to building apps for the iPhone this will be much easier. The iPhone SDK requires developers to program in objective-c which is Mac-only. The iPhone-SDK itself is only available for OS X.</p>
<p>Every time theres a new touch phone out on the market its automatically compared to Apples iPhone. So why shouldn&#8217;t I do it too?<br />
<span id="more-67"></span></p>
<p><strong>Specifications</strong><br />
The specifications for the Palm Pre.</p>
<ul>
<li>High-speed wireless (EV-DO Rev. A or HSDPA, depending on version)</li>
<li>802.11b / g WiFi with WPA, WPA2, 801.1x authentication</li>
<li>3.1-inch 24-bit color 480 x 320 display</li>
<li>Dedicated gesture area below display</li>
<li>Slide-out portrait QWERTY keyboard (banana slider)</li>
<li>Integrated IM, MMS, and SMS messaging</li>
<li>Email: Microsoft Outlook with Microsoft Direct Push Technology</li>
<li>Built-in GPS</li>
<li>Bluetooth 2.1   EDR with A2DP stereo Bluetooth support</li>
<li>High-performance browser</li>
<li>3 megapixel camera with LED flash and extended depth of field</li>
<li>3.5mm headphone jack</li>
<li>8GB of internal storage (~7.4GB user available)</li>
<li>USB mass storage support</li>
<li>Phone as laptop modem &#8211; Bluetooth tethering</li>
<li>MicroUSB connector with USB 2.0 Hi-Speed</li>
<li>Proximity sensor for detecting when phone is near face</li>
<li>Light sensor to automatically dim display</li>
<li>Audio Formats: MPS, AAC, AAC , AMR, QCELP, WAV</li>
<li>Video Formats: MPEG-4, H.263, H.264 Image Formats: GIF, Animated GIF, JPEG, PNG, BMP</li>
<li>Ringer mute switch</li>
<li>Removable rechargeable battery</li>
<li>Width: 59.5mm (2.3 inches) Height: 100.5mm (3.9 inches) Thickness: 16.95mm (0.67 inches)</li>
<li>Weight: 135 grams (4.76 ounces)</li>
</ul>
<p><strong>Network connections</strong><br />
The Palm Pre is equipped with HSDPA and WiFi. The Pre wins this duel because of the HSDPA. The iPhone is equipped with 3G which is slighty more slower than HSDPA.</p>
<p><strong>Design</strong><br />
The Pre has a 3.1-inch screen which is smaller than the iPhones 3.5-inch. The resolution is still the same on both devices though. The device itself is 0.19-inches thicker than the iPhone. The biggest difference is the slide down qwerty keyboard. As we all know the iPhone has a touch based qwerty keyboard. Having real buttons is probably the best. Pre 2 &#8211; iPhone 0.</p>
<p><strong>Operating System</strong><br />
The iPhone is equipped with a lightwheight version of Mac OS X Leopard. Developing applications for the iPhone can only be done through using OS X and downloading the SDK. The Pre comes with an OS called WebOS which is linux based. Open standards are used for developing applications for the Pre. Every application is written in HTML, CSS, JavaScript and XML. This again looks very promising. Another cool feature is the support for background processes. As we can see in this movie messages and notifications pops up on top of the current window the user is interacting with.</p>
<p>I seriously consider selling my iPhone and buying one of these!</p>
<p><object width="480" height="295" data="http://www.youtube.com/v/UiQzCd2OnoM&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/UiQzCd2OnoM&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
<p>Some more videos.</p>
<p><object width="400" height="302" data="http://vimeo.com/moogaloop.swf?clip_id=2798572&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=2798572&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /></object></p>
<p><object width="400" height="302" data="http://vimeo.com/moogaloop.swf?clip_id=2798483&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=2798483&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scratchmytail.com/2009/01/14/palm-pre-introduced-at-ces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<img style='margin:0;padding:0;border:0;' width='1px' height='1px' src="http://www.scratchmytail.com/wp-content/plugins/mystat/mystat.php?act=time_load&id=24358&rnd=631888618" /></channel>
</rss>
