<?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>simra &#187; iphone</title>
	<atom:link href="http://www.simra.ch/category/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simra.ch</link>
	<description>development &#38; design</description>
	<lastBuildDate>Fri, 26 Mar 2010 15:57:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iPhone Tutorial 2 (Interface Builder &#8211; Downloader)</title>
		<link>http://www.simra.ch/2010/02/iphone-tutorial-2-interface-builder-downloader/</link>
		<comments>http://www.simra.ch/2010/02/iphone-tutorial-2-interface-builder-downloader/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 19:54:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[interface builder]]></category>
		<category><![CDATA[UIButton]]></category>
		<category><![CDATA[UITextField]]></category>
		<category><![CDATA[UITextView]]></category>

		<guid isPermaLink="false">http://www.simra.ch/?p=1134</guid>
		<description><![CDATA[In diesem Tutorial geht es darum ein einfaches iPhone-App zu erstellen, dass eine beliebige Url herunterläd und den Inhalt ausgibt. Zusätzlich wird der Interface Builder kurz vorgestellt.

Wenn die iPhone SDK bereits installiert wurde, erscheint das folgende Fenseter mit den iPhone Projekt Templates. Wir wählen das Letzte &#8220;Window-Based Application&#8221; und nennen das Projekt &#8220;downloader&#8221;.

Wenn wir unmittelbar [...]]]></description>
			<content:encoded><![CDATA[<p>In diesem Tutorial geht es darum ein einfaches iPhone-App zu erstellen, dass eine beliebige Url herunterläd und den Inhalt ausgibt. Zusätzlich wird der Interface Builder kurz vorgestellt.<br />
<span id="more-1134"></span><br />
Wenn die iPhone SDK bereits installiert wurde, erscheint das folgende Fenseter mit den iPhone Projekt Templates. Wir wählen das Letzte &#8220;Window-Based Application&#8221; und nennen das Projekt <strong>&#8220;downloader&#8221;</strong>.</p>
<p><img class="aligncenter size-full wp-image-1135" title="iphone-new-project-2" src="http://www.simra.ch/wordpress/../uploads/2010/02/iphone-new-project-2.png" alt="" width="450" height="332" /></p>
<p>Wenn wir unmittelbar nach dem Erstellen des Projekts auf <strong>&#8220;Build and Go&#8221;</strong> klicken erscheint ein leeres Fenster. Als nächstes werden wir ein kleines Formular mit Textbox, Button und Textarea kreieren.</p>
<p>Dazu öffnen wir die Datei MainWindow.xib (Mehr zur Bedeutung der Standard Dateien finden Sie <a title="iPhone SDK Standard Dateien" href="http://www.simra.ch/2010/02/iphone-sdk-standard-dateien/" target="_blank">hier</a>). Das ist die Ansicht (View), die als Erstes gestartet wird.</p>
<p>Wenn sich der Interface-Builder gestartet hat, fügen wir über die Library ein <strong>UITextField</strong>, ein <strong>UIButton</strong> und ein <strong>UITextView</strong> zum leeren Fenster hinzu. Dannach sollte das Fenster wie folgt aussehen.</p>
<p><img src="http://www.simra.ch/wordpress/../uploads/2010/02/tutorial-2-1.png" alt="" title="tutorial-2-1" width="200" height="313" class="aligncenter size-full wp-image-1157" /></p>
<p>Als nächstes müssen wir die Delegationen für diese drei Elemente (<strong>UITextField, UIButton und UITextView</strong>) definieren.<br />
Dies geschiet in der Header-Datei <strong>downloaderAppDelegate.h</strong>.</p>
<div class="codecolorer-container objc default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6e371a;">#import &lt;UIKit/UIKit.h&gt;</span><br />
<br />
<span style="color: #a61390;">@interface</span> downloaderAppDelegate <span style="color: #002200;">:</span> <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/"><span style="color: #400080;">NSObject</span></a> &lt;UIApplicationDelegate&gt; <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; UIWindow <span style="color: #002200;">*</span>window;<br />
&nbsp; &nbsp; <span style="color: #11740a; font-style: italic;">// Die Url-Eingabe</span><br />
&nbsp; &nbsp; IBOutlet UITextField <span style="color: #002200;">*</span> url;<br />
&nbsp; &nbsp; <span style="color: #11740a; font-style: italic;">// Die Ausgabe </span><br />
&nbsp; &nbsp; IBOutlet UITextView <span style="color: #002200;">*</span> content;<br />
<span style="color: #002200;">&#125;</span><br />
<br />
<span style="color: #11740a; font-style: italic;">// Unser Download-Button</span><br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>IBAction<span style="color: #002200;">&#41;</span>download<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>sender;<br />
<br />
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> IBOutlet UIWindow <span style="color: #002200;">*</span>window;<br />
<br />
<span style="color: #a61390;">@end</span></div></div>
<p><em>Die Funktion <strong>IBAction</strong> wird später der Click-Event des Download-Buttons.</em></p>
<p>Jetzt müssen wir die beiden deklarierten <strong>IBOutlet</strong> und unsere <strong>IBAction</strong> mit den Elementen verknüpfen. Dazu öffnen wir wieder die Datei <strong>MainWindow.xib</strong> und somit den Interface-Builder. Um ein Element zu verknüpfen kann der <strong>Connections Inspector</strong> verwendet werden oder es wird mit der rechten Maustaste auf das gewünschte Objekt geklickt (siehe folgende Abbildungen).</p>
<p><img src="http://www.simra.ch/wordpress/../uploads/2010/02/tutorial-2-2.png" alt="" title="tutorial-2-2" width="450" height="361" class="aligncenter size-full wp-image-1155" /><br />
<em>Rechtsklick auf das UITextField und im Menu rechts neben <strong>&#8220;New Referencing Outlet&#8221;</strong> auf den Kreis klicken und mit der Maus auf <strong>downloaderAppDelegate</strong> ziehen und Variable <strong>url</strong> auswählen.</em></p>
<p>Nun verknüpfen wir den Button mit der <strong>IBAction</strong>, damit wir später den Click-Event bekommen.</p>
<p><img src="http://www.simra.ch/wordpress/../uploads/2010/02/tutorial-2-3.png" alt="" title="tutorial-2-3" width="450" height="362" class="aligncenter size-full wp-image-1160" /><br />
<em>Rechtsklick auf den <strong>UIButton</strong> und im Menu rechts neben <strong>&#8220;Touch Up Inside&#8221;</strong> auf den Kreis klicken und mit der Maus auf <strong>downloaderAppDelegate</strong> ziehen und Variable <strong>download</strong> auswählen.</em></p>
<p>Jetzt brauchen wir noch das <strong>UITextView</strong> zu verknüpfen. Das geschieht gleich wie beim <strong>UITextField</strong>.<br />
<img src="http://www.simra.ch/wordpress/../uploads/2010/02/tutorial-2-4.png" alt="" title="tutorial-2-4" width="450" height="361" class="aligncenter size-full wp-image-1161" /></p>
<p>Wenn das getan ist und das Progamm immer noch startet, können wir mit dem eigentlichen Programmieren beginnen.<br />
Dazu öffnen wir die Datei <strong>downloaderAppDelegate.m</strong> und passen den Code wie folgt an.</p>
<div class="codecolorer-container objc default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6e371a;">#import &quot;downloaderAppDelegate.h&quot;</span><br />
<br />
<span style="color: #a61390;">@implementation</span> downloaderAppDelegate<br />
<br />
<span style="color: #a61390;">@synthesize</span> window;<br />
<br />
<br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>applicationDidFinishLaunching<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>application <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #11740a; font-style: italic;">//Starttext </span><br />
&nbsp; &nbsp; content.text <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Enter a url and press <span style="color: #2400d9;">\&quot;</span>Download<span style="color: #2400d9;">\&quot;</span>&quot;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #11740a; font-style: italic;">//Url Vorschlag</span><br />
&nbsp; &nbsp; url.text <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;http://www.simra.ch/&quot;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #11740a; font-style: italic;">// Override point for customization after application launch</span><br />
&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>window makeKeyAndVisible<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span><br />
<br />
<span style="color: #11740a; font-style: italic;">//Click Event des Download Buttons</span><br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>IBAction<span style="color: #002200;">&#41;</span>download<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>sender<br />
<span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #11740a; font-style: italic;">//Statustext</span><br />
&nbsp; &nbsp; content.text<span style="color: #002200;">=</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;downloading...<span style="color: #2400d9;">\n</span>please wait...&quot;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #11740a; font-style: italic;">//Url anfordern</span><br />
&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURLRequest_Class/"><span style="color: #400080;">NSURLRequest</span></a> <span style="color: #002200;">*</span>req<span style="color: #002200;">=</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURLRequest_Class/"><span style="color: #400080;">NSURLRequest</span></a> requestWithURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/"><span style="color: #400080;">NSURL</span></a> URLWithString<span style="color: #002200;">:</span>url.text<span style="color: #002200;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cachePolicy<span style="color: #002200;">:</span>NSURLRequestUseProtocolCachePolicy<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; timeoutInterval<span style="color: #002200;">:</span>30.0<span style="color: #002200;">&#93;</span>;<br />
<br />
&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURLResponse_Class/"><span style="color: #400080;">NSURLResponse</span></a> <span style="color: #002200;">*</span>res <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;<br />
&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSError_Class/"><span style="color: #400080;">NSError</span></a> <span style="color: #002200;">*</span>err <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;<br />
&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/"><span style="color: #400080;">NSData</span></a> <span style="color: #002200;">*</span>dat <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/"><span style="color: #400080;">NSURLConnection</span></a> sendSynchronousRequest<span style="color: #002200;">:</span> req returningResponse<span style="color: #002200;">:</span> <span style="color: #002200;">&amp;</span>res error<span style="color: #002200;">:</span> <span style="color: #002200;">&amp;</span>err<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>res<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> <span style="color: #002200;">*</span> str <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> alloc<span style="color: #002200;">&#93;</span> initWithData<span style="color: #002200;">:</span>dat encoding<span style="color: #002200;">:</span>NSUTF8StringEncoding<span style="color: #002200;">&#93;</span>; <br />
&nbsp; &nbsp; &nbsp; &nbsp; content.text <span style="color: #002200;">=</span>str;<br />
&nbsp; &nbsp; <span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #11740a; font-style: italic;">// Vorgang fehlgeschlagen -&gt; Meldung ausgeben</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; content.text <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Url couldn't be downloaded...&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; UIAlertView <span style="color: #002200;">*</span>msg <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIAlertView alloc<span style="color: #002200;">&#93;</span> initWithTitle<span style="color: #002200;">:</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Error&quot;</span> message<span style="color: #002200;">:</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Url couldn't be downloaded&quot;</span> delegate<span style="color: #002200;">:</span> self cancelButtonTitle<span style="color: #002200;">:</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Ok&quot;</span> otherButtonTitles<span style="color: #002200;">:</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>msg show<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>msg release<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; <span style="color: #002200;">&#125;</span><br />
<span style="color: #002200;">&#125;</span><br />
<br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>dealloc <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>window release<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>super dealloc<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span><br />
<br />
<br />
<span style="color: #a61390;">@end</span></div></div>
<p>Das ganze Projekt kann <a href="http://www.simra.ch/uploads/downloads/iphone/downloader/iphone-downloader.zip">hier</a> heruntergeladen werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simra.ch/2010/02/iphone-tutorial-2-interface-builder-downloader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Tutorial 1 (UITableView)</title>
		<link>http://www.simra.ch/2010/02/iphone-tutorial-1-uitableview/</link>
		<comments>http://www.simra.ch/2010/02/iphone-tutorial-1-uitableview/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 20:39:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[UITableView]]></category>

		<guid isPermaLink="false">http://www.simra.ch/?p=1105</guid>
		<description><![CDATA[In diesem ersten Tutorial geht es darum ein einfaches iPhone-App betehend aus einem UITableView zu erstellen. Es soll zeigen, wie ein Text in eine Zelle dieser Table-Übersicht geschrieben wird.

Wenn die iPhone SDK bereits installiert wurde, erscheint das folgende Fenseter mit den iPhone Projekt Templates. Wählen Sie das Erste &#8220;Navigation-Based Application&#8221; und geben Sie ein Projektname [...]]]></description>
			<content:encoded><![CDATA[<p>In diesem ersten Tutorial geht es darum ein einfaches iPhone-App betehend aus einem UITableView zu erstellen. Es soll zeigen, wie ein Text in eine Zelle dieser Table-Übersicht geschrieben wird.<br />
<span id="more-1105"></span><br />
Wenn die iPhone SDK bereits installiert wurde, erscheint das folgende Fenseter mit den iPhone Projekt Templates. Wählen Sie das Erste &#8220;Navigation-Based Application&#8221; und geben Sie ein Projektname (Hier tutorial-1).</p>
<p><img class="aligncenter size-full wp-image-1110" title="iphone-new-project" src="http://www.simra.ch/wordpress/../uploads/2010/02/iphone-new-project.png" alt="" width="450" height="332" /></p>
<p>Wenn Sie unmittelbar nach dem Erstellen des Projekts auf <strong>&#8220;Build and Go&#8221;</strong> klicken erscheint eine leere Table-Übersicht. Als nächstes werden wir eine neue Zeile mit Text hinzufügen.</p>
<p>Dazu öffnen Sie die Datei RootViewController.m (Mehr zur Bedeutung der Standard Dateien finden Sie <a title="iPhone SDK Standard Dateien" href="http://www.simra.ch/2010/02/iphone-sdk-standard-dateien/" target="_blank">hier</a>). Das ist der View-Controller, also hier der TableView der zur Hauptansicht (main view) hinzugefügt wird.</p>
<p>Suchen Sie die Funktion <strong>numberOfRowsInSection</strong>.</p>
<div class="codecolorer-container objc default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #11740a; font-style: italic;">// Customize the number of rows in the table view.</span><br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>NSInteger<span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView numberOfRowsInSection<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>NSInteger<span style="color: #002200;">&#41;</span>section <span style="color: #002200;">&#123;</span><br />
<span style="color: #a61390;">return</span> <span style="color: #2400d9;">1</span>;<br />
<span style="color: #002200;">&#125;</span></div></div>
<p>Hier wird die Anzahl der Zeilen festgelegt. Ändern Sie den Rückgabewert von 0 auf 1, um dem Programm mitzuteilen, dass wir eine Zeile haben wollen.</p>
<p>Als nächstes muss die Funktion <strong>cellForRowAtIndexPath</strong> angepasst werden. Diese Funktion wird für jede Zeile einmal aufgerufen. Hier kann auch der Zellentext gesetzt werden.</p>
<div class="codecolorer-container objc default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #11740a; font-style: italic;">// Customize the appearance of table view cells.</span><br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UITableViewCell <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView cellForRowAtIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSIndexPath_Class/"><span style="color: #400080;">NSIndexPath</span></a> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>indexPath <span style="color: #002200;">&#123;</span><br />
<br />
<span style="color: #a61390;">static</span> <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> <span style="color: #002200;">*</span>CellIdentifier <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Cell&quot;</span>;<br />
<br />
UITableViewCell <span style="color: #002200;">*</span>cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>tableView dequeueReusableCellWithIdentifier<span style="color: #002200;">:</span>CellIdentifier<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>cell <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UITableViewCell alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>CGRectZero reuseIdentifier<span style="color: #002200;">:</span>CellIdentifier<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span><br />
<br />
<span style="color: #11740a; font-style: italic;">// Set up the cell...</span><br />
<span style="color: #002200;">&#91;</span>cell setText<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Hier kommt unser Text&quot;</span><span style="color: #002200;">&#93;</span>;<br />
<br />
<span style="color: #a61390;">return</span> cell;<br />
<span style="color: #002200;">&#125;</span></div></div>
<p>Der Funktion wurde nur der Aufruf der Methode <strong>setText</strong> der Zelle mit dem Parameter <strong>&#8220;Hier kommt unser Text&#8221;</strong> hinzugefügt. Dass &#8220;@&#8221; muss beim Objective-C vor jedem String stehen.<br />
<em>[cell setText:@"Hier kommt unser Text"];</em></p>
<p>Wenn Sie jetzt wieder auf <strong>&#8220;Build and Go&#8221;</strong> klicken erscheint der Text <strong>&#8220;Hier kommt unser Text&#8221;</strong> in der Zelle.</p>
<p><img class="aligncenter size-full wp-image-1122" title="result-tutorial-1" src="http://www.simra.ch/wordpress/../uploads/2010/02/result-tutorial-1.png" alt="" width="319" height="157" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simra.ch/2010/02/iphone-tutorial-1-uitableview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone SDK Standard Dateien</title>
		<link>http://www.simra.ch/2010/02/iphone-sdk-standard-dateien/</link>
		<comments>http://www.simra.ch/2010/02/iphone-sdk-standard-dateien/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 11:57:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[interface builder]]></category>
		<category><![CDATA[xcode]]></category>
		<category><![CDATA[xib]]></category>

		<guid isPermaLink="false">http://www.simra.ch/?p=1114</guid>
		<description><![CDATA[Hello_WorldAppDelegate.m – All of the magic starts here.  Consider this file our starting point for execution.  The main.m file invokes this object.]]></description>
			<content:encoded><![CDATA[<p>Nach dem Sie ein neues iPhone Projekt erstellt haben, finden Sie diverse vordefinierte Dateien. Im folgenden wird die Bedeutung dieser Dateien kurz erläutert.<br />
<span id="more-1114"></span></p>
<ul>
<li><strong>CoreGraphics.framework, Foundation.framwork, UIKit.framework</strong> &#8211; Das sind die Library-Files, die von Apple für die iPhone Programmierung mitgeliefert werden. Sie werden ganz normal als Includes wie in anderen Programmiersprachen eingebunden.</li>
<li><strong>Projekt-Name.app</strong> &#8211; Das ist die Programmdatei, die anschliessend auf dem iPhone installiert wird.</li>
<li><strong>MainWindow.xib</strong> &#8211; .xib Datien sind Interface-Builder-Dateien, die visuelle Information (Buttons, Textboxen etc.) enthalten. Die MainWindow.xib ist die Hauptansicht, die zuallererst getartet wird. Wir eine .xib Datei doppelt angeklickt, öffnet sich der Interface Builder.</li>
<li><strong>Projekt-NameAppDelegate.h</strong> &#8211; Das ist die Header-Datei unsere Hauptansicht. Sie enthät alle Definitionen für Variablen, die gebraucht werden. Sie entspricht in etwa einer Header-Datei in C oder C++.</li>
<li><strong>Projekt-NameAppDelegate.m</strong> &#8211; Sie ist der Startpunkt unseres Programms und enthält die Funktionen für unsere Hauptansicht. Sie wird von der Datei main.m aufgerufen.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.simra.ch/2010/02/iphone-sdk-standard-dateien/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
