<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>YABoW @ trappers.tk</title> <link>http://www.trappers.tk/site</link> <description>Yet Another Boring Weblog</description> <lastBuildDate>Sat, 27 Apr 2013 09:33:00 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.5.1</generator> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/jeroentrappers" /><feedburner:info uri="jeroentrappers" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Stackoverflow</title><link>http://feedproxy.google.com/~r/jeroentrappers/~3/IPch3Ng6C2s/</link> <comments>http://www.trappers.tk/site/2012/05/19/stackoverflow/#comments</comments> <pubDate>Sat, 19 May 2012 19:00:54 +0000</pubDate> <dc:creator>Jeroen Trappers</dc:creator> <category><![CDATA[tinternet]]></category><guid isPermaLink="false">http://www.trappers.tk/site/?p=489</guid> <description><![CDATA[If you are visiting here from Stackoverflow.com, welcome. Today some Moderator at StackOverflow decided to remove 4 or 5 of my answers, because they all contained a link to my blog. May I promote products or websites I am affiliated with here? Be careful, because the community frowns on overt self-promotion and tends to vote&#8230; <a
href="http://www.trappers.tk/site/2012/05/19/stackoverflow/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>If you are visiting here from Stackoverflow.com, welcome. Today some Moderator at StackOverflow decided to remove 4 or 5 of my answers, because they all contained a link to my blog.</p><blockquote><p>May I promote products or websites I am affiliated with here?</p></blockquote><div><blockquote><p>Be careful, because the community frowns on overt self-promotion and tends to vote it down and flag it as spam. Post good, relevant answers, and if some (but not all) happen to be about your product or website, so be it. However, you <em>must</em> disclose your affiliation in your answers.</p></blockquote></div><div><blockquote><p>If a huge percentage of your posts include a mention of your product or website, you&#8217;re probably here for the wrong reasons. Our advertising rates are quite reasonable; contact our ad sales team for details. We also offer free community promotion ads for open source projects and non-profit organizations.</p></blockquote><p>Indeed in the FAQ it says that that is not allowed. However my answers were tailored to the questions and were in each case a correct and useful answer. The link to my blog is because I don&#8217;t want to repeat myself, plus you cannot post screenshots easily in StackOverflow. If I spend 4 hours to write a detailed tutorial with lots of screenshots,  that answers relevant SO questions, I don&#8217;t see a reason why it is not allowed to link to it. My code is open source under MIT license. I don&#8217;t have a lot of advertisement on my blog. Hell, google adsense hasn&#8217;t paid out for more than two years now. I don&#8217;t even sell anything.</p><p>So in the future, I&#8217;m no longer posting to SO myself. If you find a relevant question on SO that one of my blogposts answers, you may ofcourse link to them.</p><p>kthxbye.</p></div><script type="text/javascript">addthis_url='http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2012%2F05%2F19%2Fstackoverflow%2F';addthis_title='Stackoverflow';addthis_pub='';</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script><p><a
href="http://www.trappers.tk/site/?flattrss_redirect&amp;id=489&amp;md5=257281f9b2aa93be7c12f5c49e122ca3" title="Flattr" target="_blank"><img
src="http://www.trappers.tk/site/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/jeroentrappers/~4/IPch3Ng6C2s" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.trappers.tk/site/2012/05/19/stackoverflow/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=jeroentrappers&amp;popout=1&amp;url=http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2012%2F05%2F19%2Fstackoverflow%2F&amp;language=sq_AL&amp;category=text&amp;title=Stackoverflow&amp;description=If+you+are+visiting+here+from+Stackoverflow.com%2C+welcome.+Today+some+Moderator+at+StackOverflow+decided+to+remove+4+or+5+of+my+answers%2C+because+they+all+contained+a+link+to+my...&amp;tags=blog" type="text/html" /> <feedburner:origLink>http://www.trappers.tk/site/2012/05/19/stackoverflow/</feedburner:origLink></item> <item><title>Strongly typed Table View Cells to make your life easier</title><link>http://feedproxy.google.com/~r/jeroentrappers/~3/4KIBdnoKseI/</link> <comments>http://www.trappers.tk/site/2012/05/19/strongly-typed-table-view-cells-to-make-your-life-easier/#comments</comments> <pubDate>Sat, 19 May 2012 06:03:11 +0000</pubDate> <dc:creator>Jeroen Trappers</dc:creator> <category><![CDATA[apple]]></category><guid isPermaLink="false">http://www.trappers.tk/site/?p=432</guid> <description><![CDATA[Lots of people seem to be having problems with designing and implementing easy to use and easy to maintain table view cells, for use in a UITableView on iOS. There is actually quite a nice way to make your life easy. In this article I&#8217;ll show the basic technique on how to do it. We&#8230; <a
href="http://www.trappers.tk/site/2012/05/19/strongly-typed-table-view-cells-to-make-your-life-easier/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Lots of people seem to be having problems with designing and implementing easy to use and easy to maintain table view cells, for use in a UITableView on iOS. There is actually quite a nice way to make your life easy. In this article I&#8217;ll show the basic technique on how to do it.</p><p><a
style="color: #ff4b33; line-height: 24px; font-size: 16px;" href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-1.png"><br
class="Apple-interchange-newline" /><img
class="alignright size-full wp-image-451" title="step 1" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-1.png" alt="" width="535" height="113" /></a></p><p>We start with a new demo project, where we use the single view application template.<br
/> In this tutorial we will use the iPhone version, but the technique applies just a easily to iPad applications of course.</p><p>Let&#8217;s call the project StronglyTypedTableViewCell. <a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-2.png"><img
class="alignright size-full wp-image-463" title="step 2" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-2.png" alt="" width="518" height="218" /></a>In this project template we get a ViewController with a Xib file for free. Open the xib and add a table view to the view by dragging it in from the object library.<a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-3.png"><img
class="alignright size-full wp-image-464" title="step 3" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-3.png" alt="" width="736" height="605" /></a></p><p>Link the UITableView to the file owner, by control-click-dragging from the table to the file owner twice. Once for the delegate, once for the data source.<a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-4.png"><img
class="alignright size-full wp-image-465" title="step 4" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-4.png" alt="" width="632" height="312" /></a><a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-5.png"><img
class="alignright size-full wp-image-466" title="step 5" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-5.png" alt="" width="487" height="177" /></a></p><p>We switch over to the code, and indicate in the ViewController, that is the file owner of the objects created visually in the xib file, that it conforms to the protocols required by the UITableView links: UITableViewDelegate and UITableViewDataSource. In the ViewController.h header file: change this line of code:</p><pre class="brush:objc">@interface ViewController : UIViewController
    <strong>&lt;UITableViewDelegate, UITableViewDataSource&gt;</strong></pre><p>We need to implement two required methods in the ViewController. We start with dummy implementation to get rid of the compiler warnings. So in ViewController.m write:</p><pre class="brush:objc">- (NSInteger)tableView:(UITableView *)tableView
 numberOfRowsInSection:(NSInteger)section
{
  return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView
         cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
  return nil;
}</pre><p>The first method is called first by the UITableView to find out the total number of rows that needs to be displayed in a certain section. For this demo, we are not using sections, so we just return 1 for now. We don&#8217;t have any data yet.</p><p>The second method will then be called by the UITableView for getting the cell that needs to be displayed for the rows that are visible in the View. Normally this is only the first 12 rows, when you don&#8217;t change the row height.</p><p>Great. The skeleton for the tutorial is ready. Now we need to fabricate some data. Lets work with Cars for the tutorial. Let&#8217;s structure the code in a good object oriented way and add a new class to the project called Car. (Cmd-N, or File-&gt;New File) Select Objective-C class and give it the name Car.<a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-6.png"><img
class="alignright size-full wp-image-467" title="step 6" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-6.png" alt="" width="293" height="103" /></a><a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-7.png"><img
class="size-full wp-image-468 alignnone" title="step 7" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-7.png" alt="" width="522" height="113" /></a></p><p>For this demo, a car has two properties: The Make and the Type, both of type string. So in Car.h write:</p><pre class="brush:objc">#import &lt;Foundation/Foundation.h&gt;

@interface Car : NSObject

<strong> @property (nonatomic, strong) NSString *make;  </strong>
<strong> @property (nonatomic, strong) NSString *type; </strong>

@end</pre><p>and then in Car.m we complete the implementation section by synthesizing the implementation for those properties.</p><pre class="brush:objc">#import "Car.h"

@implementation Car

<strong>@synthesize make = _make;  </strong>
<strong>@synthesize type = _type;</strong>

@end</pre><p>In the ViewController, we create a property to hold a number of cars. This property doesn&#8217;t need to be public, so we can write it in the private interface section in the ViewController.m file. This is called an &#8220;Extension&#8221;. Kind of like an anonymous Category in Objective-C.</p><pre class="brush:objc">@interface ViewController ()

@property (nonatomic, strong) NSMutableArray *cars;

@end</pre><p>and again we synthesize it in the implementation section (ViewController.m):</p><pre class="brush:objc">@synthesize cars = _cars;</pre><p>Now we can start by creating a couple of test objects to show in the cells of the UITableView. However, to make our code a little bit better, we will implement our own init method in the Car class. We start by defining the method in the public header Car.h:</p><pre class="brush:objc">- (id) initWithMake:(NSString*) make
               type:(NSString*) type;</pre><p>The implementation is very straightforward, in Car.m write:</p><pre class="brush:objc">- (id) initWithMake:(NSString*) make
               type:(NSString*) type
{
    self = [super init];
    if (self)
    {
        self.make = make;
        self.type = type;
    }
    return self;
}</pre><p>Among other things, this is a reason why we prefixed the name of the instance variable (ivar) that belongs with the property with an underscore. This way we have no conflict with the parameter names in this method.</p><p>Very well, now for the data. First import Car.h in ViewController.m, to make the class available. Next, in the viewDidLoad method of the ViewController, write (or copy paste <img
src='http://www.trappers.tk/site/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ):</p><pre class="brush:objc">    self.cars = [[NSMutableArray alloc]initWithCapacity:14];

    [self.cars addObject:[[Car alloc]initWithMake:@"Volkswagen" type:@"Polo"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Ford" type:@"Mondeo"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Mini" type:@"Cooper"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"BMW" type:@"X3"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Audi" type:@"Q5"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Renault" type:@"Wind"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Chevrolet" type:@"Impala"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Porsche" type:@"928"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Lamborghini" type:@"Murchielago"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Fisker" type:@"Karma"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Nissan" type:@"Leaf"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Toyota" type:@"Auris"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Citroen" type:@"DS5"]];
    [self.cars addObject:[[Car alloc]initWithMake:@"Peugeot" type:@"205"]];</pre><p>The preparations are complete. We can now show that data in the table. We change the implementation of the two methods to reflect the data we have. In the first method, we return the number of cars we have:</p><pre class="brush:objc">- (NSInteger)tableView:(UITableView *)tableView
 numberOfRowsInSection:(NSInteger)section
{
    <strong>return self.cars.count;</strong>
}</pre><p>In the second, we return a standard UITableViewCell, to show the information about the car, for now we will just use one of the built-in Styles. We implement the reuse mechanism that UITableView supports. This way only 12 or so table view cells will ever need to be created, and we just reuse the existing ones, that fall off screen when the user is scrolling.</p><pre class="brush:objc">- (UITableViewCell *)tableView:(UITableView *)tableView
         cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // static string is only initialized once for this method.
    static NSString *reuseId = @"carCell";

    // try to reuse an existing table view cell.
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId]; 

    if(nil == cell)
    {
        // if no cell is available for reuse, we create it, with the same reuseId.
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseId];
    }

    // next we customize the content of the TableViewCell

    // get the object we want to show:
    Car *car = [self.cars objectAtIndex:indexPath.row];

    cell.textLabel.text = car.make;
    cell.detailTextLabel.text = car.type;

    // return the customized cell
    return cell;
}</pre><p>So far so good. This is the standard way of showing data in a UITableView. Nothing new. You can run the code on your device, or in the simulator.<a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-8.png"><img
class="size-full wp-image-452 aligncenter" title="step 8" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-8.png" alt="" width="379" height="741" /></a></p><p>Now we are going to create a custom cell, with a nice, typed API. Let&#8217;s get started.</p><p>We start by creating a new class called CarCell. This class will be responsible for encapsulating the Cell itself, and providing an easy to use API for our other classes. It inherits from the built-in UITableViewCell. Cmd-N or File-&gt; New File. Select Objective-C Class and provide the name and super class. <a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-9.png"><img
class="alignright size-full wp-image-453" title="step 9" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-9.png" alt="" width="518" height="71" /></a></p><p>&nbsp;</p><p>&nbsp;</p><p><img
class="alignright size-full wp-image-454" title="step 10" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-10.png" alt="" width="351" height="85" /></p><p>We will also create a Xib, because we want to visually configure the custom cell. Cmd-N or File -&gt; New File. This time select User Interface, Empty Xib. Name it CarCell too.<a
style="color: #ff4b33; line-height: 24px;" href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-11.png"><img
class="alignnone size-full wp-image-469" title="step 11" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-11.png" alt="" width="348" height="57" /></a></p><p><a
style="color: #ff4b33; line-height: 24px; font-size: 16px;" href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-13.png"><br
class="Apple-interchange-newline" /><img
class="alignright size-full wp-image-455" title="step 13" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-13.png" alt="" width="374" height="142" /></a></p><p>In the xib file, drag a UITableViewCell from the object library into the design surface.Next, add two labels to the cell. Increase the height of the cell a bit, and make the first label bold text.</p><p><a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-14.png"><img
class="alignright size-full wp-image-471" title="step 14" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-14.png" alt="" width="682" height="218" /></a>This is important: we are going to <strong>change the identity</strong> of the UITableViewCell. Make sure the Cell itself is selected and in the Identity Inspector, change the class to CarCell. Great. This way, when the nib is loaded, an instance of our CarCell will be created.</p><p><a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-201.png"><img
class="alignright size-full wp-image-480" title="step 20" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-201.png" alt="" width="246" height="99" /></a>In the properties Inspector, also setup the reuse identifier for the cell. This should match the reuse identifier we use from code.</p><p>Now we can easily create two outlets, again visually. We need to open up the Assistant Editor, and make sure that the content of CarCell.h is shown there.<a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-15.png"><img
class="alignright size-full wp-image-456" title="step 15" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-15.png" alt="" width="689" height="161" /></a></p><p>Next, Control-drag from the first label to the code in the assistant editor. It will prompt to create an outlet. Let it do it&#8217;s job and give it the name makeLabel. Do the same for the second label and call it typeLabel.</p><p><a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-16.png"><img
class="alignright size-full wp-image-457" title="step 16" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-16.png" alt="" width="684" height="172" /></a></p><p>By doing this visually, all the necessary code has been generated for you by XCode.</p><p>Now we only need to be able to use the custom strongly typed cell in our table. That&#8217;s the tricky bit. Here, we need to change the file owner of the CarCell.Xib. Currently it doesn&#8217;t really have one. <a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-17.png"><img
class="alignright size-full wp-image-472" title="step 17" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-17.png" alt="" width="916" height="234" /></a>Select the file owner icon and open the identity inspector again, and change the class from NSObject to ViewController.</p><p>We will create an IBOutlet in the ViewController to easily get access to the CarCell object when it is loaded. So again, open up the Assistant Editor. Make sure that the content of ViewController.h is showing up and control drag from the CarCell itself into the code to create the IBOutlet. Call it carCellTemplate. Make sure it is a strong property.</p><p><a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-18.png"><img
class="alignright size-full wp-image-473" title="step 18" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-18.png" alt="" width="895" height="415" /></a></p><p><img
class="alignright size-full wp-image-458" title="step 19" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-19.png" alt="" width="625" height="242" /></p><p>Great. Now we can change the implementation of the second TableViewDataSource method to use our custom cell.<br
/> Start by importing CarCell.h into ViewController.h.</p><pre class="brush:objc">- (UITableViewCell *)tableView:(UITableView *)tableView
         cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // static string is only initialized once for this method.
    static NSString *reuseId = @"carCell";

    // try to reuse an existing table view cell.
    CarCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId]; 

    if(nil == cell)
    {
        // if no cell is available for reuse, we create it, with the same reuseId.
        // instead of using a standard UITableViewCell style, we create our custom CarCell

        // load the objects in the nib, and setup the "file owner" to self
        <strong>[[NSBundle mainBundle] loadNibNamed:@"CarCell" owner:self options:nil];</strong>

        // at this point, self.carCellTemplate points to the CarCell that
        // was defined in the Xib.

        // so now we have a reference to it.
        <strong>cell = self.carCellTemplate;</strong>
    }

    // next we customize the content of the TableViewCell

    // get the object we want to show:
    Car *car = [self.cars objectAtIndex:indexPath.row];

    // we now have a typed api to customize our cell:
    cell.makeLabel.text = car.make;
    cell.typeLabel.text = car.type;

    // return the customized cell
    return cell;
}</pre><p>We are almost done. If you run the project now, you will notice that cells are not shown correctly. This is because the height of the rows has increased.</p><p><a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-21.png"><img
class="size-full wp-image-460 aligncenter" title="step 21" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-21.png" alt="" width="329" height="490" /></a></p><p>That is usually the case when you design a custom cell. Therefore we need to get the height of the cell. You can read it from the designer. eg. 90px. <a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-22.png"><img
class="alignright size-full wp-image-461" title="step 22" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-22.png" alt="" width="261" height="49" /></a>And we need to implement one method in the ViewController. The tableview will ask it how high each cell needs to be. Notice that this method has to be very fast, because the TableView needs to know before doing anything how high the entire content will be to setup the scrollView.</p><pre class="brush:objc">- (CGFloat)tableView:(UITableView *)tableView
    heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 90;
}</pre><p>We&#8217;re done. The result is not spectacular, but now you can easily start adding other user interface elements to the cell, without having to calculate or guess their positions.</p><p><a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-23.png"><img
class="size-full wp-image-462 aligncenter" title="step 23" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/step-23.png" alt="" width="389" height="746" /></a></p><p>In summary, what we did: Create a custom class CarCell that represents and encapsulates the cell. It is in that class that we define the API for manipulating and customizing the contents of our custom cell. Create the layout for that custom cell in a Xib, and make sure you manage the identity of the cell, so that it creates an instance of your custom class when loading the nib. Also make sure you have an easy way to access the objects created when loading the xib. We do this by changing the file owner of that new xib, and using an IBOutlet to get access to the objects we are interested in. Pay attention to setup the Reuse Identifier, otherwise it is not as memory efficient as it could be.</p><p>There is room for improvement. Instead of assigning to the properties of our cell when customizing it, we could have just assigned the Car itself (to a new property), and make our custom cell class responsible for showing that car in the setter of that property. This way we need less knowledge about the cell itself outside that class. Better applying the Single Responsibility Principle, and gaining in Cohesion of the objects.</p><p>There is a common pitfall here. You should no longer use any of the properties of the standard UITableView cell, as they will usually overlap with or hide the UI elements you added. Also, because these cells are reused by the UITableView, make sure to set all values that are visible to the user. If you forget some, you will see strange results, due to the caching and reuse of cells. You could provide a &#8220;prepare for reuse&#8221; method to facilitate this.</p><p>Fork the code on <a
href="https://github.com/jeroentrappers/StronglyTypedTableViewCellTutorial">github</a> or download a <a
href="https://github.com/jeroentrappers/StronglyTypedTableViewCellTutorial/zipball/master">zip</a>.</p><p>I hope this was useful. Any feedback is very much appreciated in the comments.</p><p>kthxbye!</p><script type="text/javascript">addthis_url='http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2012%2F05%2F19%2Fstrongly-typed-table-view-cells-to-make-your-life-easier%2F';addthis_title='Strongly+typed+Table+View+Cells+to+make+your+life+easier';addthis_pub='';</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script><p><a
href="http://www.trappers.tk/site/?flattrss_redirect&amp;id=432&amp;md5=3d35b9659106e59080fbaaf1d183dff8" title="Flattr" target="_blank"><img
src="http://www.trappers.tk/site/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/jeroentrappers/~4/4KIBdnoKseI" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.trappers.tk/site/2012/05/19/strongly-typed-table-view-cells-to-make-your-life-easier/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=jeroentrappers&amp;popout=1&amp;url=http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2012%2F05%2F19%2Fstrongly-typed-table-view-cells-to-make-your-life-easier%2F&amp;language=sq_AL&amp;category=text&amp;title=Strongly+typed+Table+View+Cells+to+make+your+life+easier&amp;description=Lots+of+people+seem+to+be+having+problems+with+designing+and+implementing+easy+to+use+and+easy+to+maintain+table+view+cells%2C+for+use+in+a+UITableView+on+iOS.+There...&amp;tags=blog" type="text/html" /> <feedburner:origLink>http://www.trappers.tk/site/2012/05/19/strongly-typed-table-view-cells-to-make-your-life-easier/</feedburner:origLink></item> <item><title>Face detection with Core Image on Live Video</title><link>http://feedproxy.google.com/~r/jeroentrappers/~3/EO3ft8oEapE/</link> <comments>http://www.trappers.tk/site/2012/05/02/face-detection-with-core-image-on-live-video/#comments</comments> <pubDate>Wed, 02 May 2012 15:28:07 +0000</pubDate> <dc:creator>Jeroen Trappers</dc:creator> <category><![CDATA[apple]]></category><guid isPermaLink="false">http://www.trappers.tk/site/?p=410</guid> <description><![CDATA[In this article I will explain how to do face detection on a live video feed using an iOS 5 device. We will be using Core Image to do the heavy lifting. The code is loosely based on the SquareCam sample code from Apple. To get started, we need to show the live video of&#8230; <a
href="http://www.trappers.tk/site/2012/05/02/face-detection-with-core-image-on-live-video/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><a
href="http://www.trappers.tk/site/wp-content/uploads/2012/05/IMG_0097.png"><img
class="alignright size-medium wp-image-424" title="Mustachio" src="http://www.trappers.tk/site/wp-content/uploads/2012/05/IMG_0097-200x300.png" alt="" width="200" height="300" /></a>In this article I will explain how to do face detection on a live video feed using an iOS 5 device. We will be using Core Image to do the heavy lifting. The code is loosely based on the <a
href="http://developer.apple.com/library/ios/#samplecode/SquareCam/Introduction/Intro.html">SquareCam</a> sample code from Apple.</p><p>To get started, we need to show the live video of the front facing camera. We use AVFoundation to do this. We start by setting up the AVCaptureSession. We use 640&#215;480 as the capture resolution. Keep in mind that face detection is relatively compute intensive. The less pixels we need to munch, the faster the processing can be done. This is an interactive application, so realtime performance is important. We tell the AVCaptureSession which camera to use as input device.</p><p>To show the preview, we create an AVCaptureVideoPreviewLayer and add it to the previewView, that was created in the Xib. Don&#8217;t forget to call [session startRunning]. That was the easy part.</p><pre class="brush:c">NSError *error = nil;
AVCaptureSession *session = [[AVCaptureSession alloc] init];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
    [session setSessionPreset:AVCaptureSessionPreset640x480];
} else {
    [session setSessionPreset:AVCaptureSessionPresetPhoto];
}
// Select a video device, make an input
AVCaptureDevice *device;
AVCaptureDevicePosition desiredPosition = AVCaptureDevicePositionFront;
// find the front facing camera
for (AVCaptureDevice *d in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) {
	if ([d position] == desiredPosition) {
		device = d;
        self.isUsingFrontFacingCamera = YES;
		break;
	}
}
// fall back to the default camera.
if( nil == device )
{
    self.isUsingFrontFacingCamera = NO;
    device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
}
// get the input device
AVCaptureDeviceInput *deviceInput = [AVCaptureDeviceInput deviceInputWithDevice:device error:&amp;error];
if( !error ) {

    // add the input to the session
    if ( [session canAddInput:deviceInput] ){
        [session addInput:deviceInput];
    }

    self.previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:session];
    self.previewLayer.backgroundColor = [[UIColor blackColor] CGColor];
    self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspect;

    CALayer *rootLayer = [self.previewView layer];
    [rootLayer setMasksToBounds:YES];
    [self.previewLayer setFrame:[rootLayer bounds]];
    [rootLayer addSublayer:self.previewLayer];
    [session startRunning];

}
session = nil;
if (error) {
	UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:
                        [NSString stringWithFormat:@"Failed with error %d", (int)[error code]]
                                           message:[error localizedDescription]
									      delegate:nil
							     cancelButtonTitle:@"Dismiss"
							     otherButtonTitles:nil];
	[alertView show];
	[self teardownAVCapture];
}</pre><p>Now for the face detection.</p><p>We create the face detector itself in viewDidLoad, and keep a reference to it with a property. We use low accuracy, again for performance reasons.</p><pre class="brush:c">NSDictionary *detectorOptions = [[NSDictionary alloc] initWithObjectsAndKeys:CIDetectorAccuracyLow, CIDetectorAccuracy, nil];
self.faceDetector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:detectorOptions];</pre><p>&nbsp;</p><p>We access the data captured by the camera by creating an AVCaptureVideoDataOutput, using BGRA as pixelformat. We drop frames we cannot process. To do the actual processing, we create a separate processing queue. This feature works via the delegate method, that gets called for each frame on the processing queue.</p><pre class="brush:c">// Make a video data output
self.videoDataOutput = [[AVCaptureVideoDataOutput alloc] init];
// we want BGRA, both CoreGraphics and OpenGL work well with 'BGRA'
NSDictionary *rgbOutputSettings = [NSDictionary dictionaryWithObject:
                                   [NSNumber numberWithInt:kCMPixelFormat_32BGRA] forKey:(id)kCVPixelBufferPixelFormatTypeKey];
[self.videoDataOutput setVideoSettings:rgbOutputSettings];
[self.videoDataOutput setAlwaysDiscardsLateVideoFrames:YES]; // discard if the data output queue is blocked
// create a serial dispatch queue used for the sample buffer delegate
// a serial dispatch queue must be used to guarantee that video frames will be delivered in order
// see the header doc for setSampleBufferDelegate:queue: for more information
self.videoDataOutputQueue = dispatch_queue_create("VideoDataOutputQueue", DISPATCH_QUEUE_SERIAL);
[self.videoDataOutput setSampleBufferDelegate:self queue:self.videoDataOutputQueue];
if ( [session canAddOutput:self.videoDataOutput] ){
    [session addOutput:self.videoDataOutput];
}
// get the output for doing face detection.
[[self.videoDataOutput connectionWithMediaType:AVMediaTypeVideo] setEnabled:YES];</pre><p>The actual processing happens in the delegate method, that gets called on the background. First the frameBuffer is created, we use all attachments that come with the captured frame for processing.  We add exif information onto the image, because we need to know which side is up. The actual face detection is done in the method [self.facedetector featuresInImage:ciImage options:imageOptions];</p><pre class="brush:c">- (void)captureOutput:(AVCaptureOutput *)captureOutput
    didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
       fromConnection:(AVCaptureConnection *)connection
{
	// get the image
	CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
	CFDictionaryRef attachments = CMCopyDictionaryOfAttachments(kCFAllocatorDefault, sampleBuffer, kCMAttachmentMode_ShouldPropagate);
	CIImage *ciImage = [[CIImage alloc] initWithCVPixelBuffer:pixelBuffer
                                                      options:(__bridge NSDictionary *)attachments];
	if (attachments) {
		CFRelease(attachments);
    }

    // make sure your device orientation is not locked.
	UIDeviceOrientation curDeviceOrientation = [[UIDevice currentDevice] orientation];

	NSDictionary *imageOptions = nil;

	imageOptions = [NSDictionary dictionaryWithObject:[self exifOrientation:curDeviceOrientation]
                                               forKey:CIDetectorImageOrientation];

	NSArray *features = [self.faceDetector featuresInImage:ciImage
                                                   options:imageOptions];

    // get the clean aperture
    // the clean aperture is a rectangle that defines the portion of the encoded pixel dimensions
    // that represents image data valid for display.
	CMFormatDescriptionRef fdesc = CMSampleBufferGetFormatDescription(sampleBuffer);
	CGRect cleanAperture = CMVideoFormatDescriptionGetCleanAperture(fdesc, false /*originIsTopLeft == false*/);

	dispatch_async(dispatch_get_main_queue(), ^(void) {
		[self drawFaces:features
            forVideoBox:cleanAperture
            orientation:curDeviceOrientation];
	});
}</pre><p>The last step is to actually draw something on the screen where the face has been detected. The method drawFaces:forVideoBox:orientation is called on the main thread to do this.</p><p>In this method, we will draw an image onto a CALayer in the previewLayer. For each detected face, we will create or reuse a layer. We have to setup the correct size based on the bounds of the detected face. Take into account that the video has been scaled, so we also need to take that factor into account.  Then we position the image onto the layer. The layer in turn needs to be rotated into the right orientation. This is done based on the device orientation.</p><pre class="brush:c">// called asynchronously as the capture output is capturing sample buffers, this method asks the face detector
// to detect features and for each draw the green border in a layer and set appropriate orientation
- (void)drawFaces:(NSArray *)features
      forVideoBox:(CGRect)clearAperture
      orientation:(UIDeviceOrientation)orientation
{
	NSArray *sublayers = [NSArray arrayWithArray:[self.previewLayer sublayers]];
	NSInteger sublayersCount = [sublayers count], currentSublayer = 0;
	NSInteger featuresCount = [features count], currentFeature = 0;

	[CATransaction begin];
	[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];

	// hide all the face layers
	for ( CALayer *layer in sublayers ) {
		if ( [[layer name] isEqualToString:@"FaceLayer"] )
			[layer setHidden:YES];
	}	

	if ( featuresCount == 0 ) {
		[CATransaction commit];
		return; // early bail.
	}

	CGSize parentFrameSize = [self.previewView frame].size;
	NSString *gravity = [self.previewLayer videoGravity];
	BOOL isMirrored = [self.previewLayer isMirrored];
	CGRect previewBox = [ViewController videoPreviewBoxForGravity:gravity
                                                        frameSize:parentFrameSize
                                                     apertureSize:clearAperture.size];

	for ( CIFaceFeature *ff in features ) {
		// find the correct position for the square layer within the previewLayer
		// the feature box originates in the bottom left of the video frame.
		// (Bottom right if mirroring is turned on)
		CGRect faceRect = [ff bounds];

		// flip preview width and height
		CGFloat temp = faceRect.size.width;
		faceRect.size.width = faceRect.size.height;
		faceRect.size.height = temp;
		temp = faceRect.origin.x;
		faceRect.origin.x = faceRect.origin.y;
		faceRect.origin.y = temp;
		// scale coordinates so they fit in the preview box, which may be scaled
		CGFloat widthScaleBy = previewBox.size.width / clearAperture.size.height;
		CGFloat heightScaleBy = previewBox.size.height / clearAperture.size.width;
		faceRect.size.width *= widthScaleBy;
		faceRect.size.height *= heightScaleBy;
		faceRect.origin.x *= widthScaleBy;
		faceRect.origin.y *= heightScaleBy;

		if ( isMirrored )
			faceRect = CGRectOffset(faceRect, previewBox.origin.x + previewBox.size.width - faceRect.size.width - (faceRect.origin.x * 2), previewBox.origin.y);
		else
			faceRect = CGRectOffset(faceRect, previewBox.origin.x, previewBox.origin.y);

		CALayer *featureLayer = nil;

		// re-use an existing layer if possible
		while ( !featureLayer &amp;&amp; (currentSublayer &lt; sublayersCount) ) {
			CALayer *currentLayer = [sublayers objectAtIndex:currentSublayer++];
			if ( [[currentLayer name] isEqualToString:@"FaceLayer"] ) {
				featureLayer = currentLayer;
				[currentLayer setHidden:NO];
			}
		}

		// create a new one if necessary
		if ( !featureLayer ) {
			featureLayer = [[CALayer alloc]init];
			featureLayer.contents = (id)self.borderImage.CGImage;
			[featureLayer setName:@"FaceLayer"];
			[self.previewLayer addSublayer:featureLayer];
			featureLayer = nil;
		}
		[featureLayer setFrame:faceRect];

		switch (orientation) {
			case UIDeviceOrientationPortrait:
				[featureLayer setAffineTransform:CGAffineTransformMakeRotation(DegreesToRadians(0.))];
				break;
			case UIDeviceOrientationPortraitUpsideDown:
				[featureLayer setAffineTransform:CGAffineTransformMakeRotation(DegreesToRadians(180.))];
				break;
			case UIDeviceOrientationLandscapeLeft:
				[featureLayer setAffineTransform:CGAffineTransformMakeRotation(DegreesToRadians(90.))];
				break;
			case UIDeviceOrientationLandscapeRight:
				[featureLayer setAffineTransform:CGAffineTransformMakeRotation(DegreesToRadians(-90.))];
				break;
			case UIDeviceOrientationFaceUp:
			case UIDeviceOrientationFaceDown:
			default:
				break; // leave the layer in its last known orientation
		}
		currentFeature++;
	}

	[CATransaction commit];
}</pre><p>There you go. That is the basic principle behind Face Detection in iOS 5. For the nitty gritty details, just have a look at <a
title="the code" href="https://github.com/jeroentrappers/FaceDetectionPOC">the code</a> on github or download <a
href="http://www.trappers.tk/share/FaceDetectionPOC.zip">the zip</a>.</p><p>There is much more to be explored. Core Image also provides access to the detected location of eyes and mouth. That would be even better to place the mustache correctly. We could also rotate the image, based on the angle of the face on the screen.</p><p>Adios!</p><p>Any feedback is appreciated in the comments.</p><script type="text/javascript">addthis_url='http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2012%2F05%2F02%2Fface-detection-with-core-image-on-live-video%2F';addthis_title='Face+detection+with+Core+Image+on+Live+Video';addthis_pub='';</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script><p><a
href="http://www.trappers.tk/site/?flattrss_redirect&amp;id=410&amp;md5=24bf5fb66d1fcbc86a1f68ac274ff699" title="Flattr" target="_blank"><img
src="http://www.trappers.tk/site/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/jeroentrappers/~4/EO3ft8oEapE" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.trappers.tk/site/2012/05/02/face-detection-with-core-image-on-live-video/feed/</wfw:commentRss> <slash:comments>6</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=jeroentrappers&amp;popout=1&amp;url=http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2012%2F05%2F02%2Fface-detection-with-core-image-on-live-video%2F&amp;language=sq_AL&amp;category=text&amp;title=Face+detection+with+Core+Image+on+Live+Video&amp;description=In+this+article+I+will+explain+how+to+do+face+detection+on+a+live+video+feed+using+an+iOS+5+device.+We+will+be+using+Core+Image+to+do+the...&amp;tags=blog" type="text/html" /> <feedburner:origLink>http://www.trappers.tk/site/2012/05/02/face-detection-with-core-image-on-live-video/</feedburner:origLink></item> <item><title>Where is MainWindow.xib in Xcode 4.2?</title><link>http://feedproxy.google.com/~r/jeroentrappers/~3/xP08dbWG-RM/</link> <comments>http://www.trappers.tk/site/2012/03/14/where-is-mainwindow-xib-in-xcode-4-2/#comments</comments> <pubDate>Wed, 14 Mar 2012 21:09:25 +0000</pubDate> <dc:creator>Jeroen Trappers</dc:creator> <category><![CDATA[apple]]></category><guid isPermaLink="false">http://www.trappers.tk/site/?p=399</guid> <description><![CDATA[In one of my previous posts I explained how to create your own MainWindow.xib User Interface Document. I&#8217;ve now also created a screencast that guides you through the process. It is actually no longer necessary to use this. I personally think it is easier just to create your application from code, however it is useful&#8230; <a
href="http://www.trappers.tk/site/2012/03/14/where-is-mainwindow-xib-in-xcode-4-2/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>In <a
title="MainWindow.xib" href="http://www.trappers.tk/site/2011/06/16/mainwindow-xib/">one of my previous posts</a> I explained how to create your own MainWindow.xib User Interface Document. I&#8217;ve now also created a screencast that guides you through the process. It is actually no longer necessary to use this. I personally think it is easier just to create your application from code, however it is useful to understand how an XCode 3 iOS application is constructed.</p><p><a
href="http://www.youtube.com/watch?v=PpB-3TwJvQE">Where is MainWindow.xib in XCode 4</a> on youtube</p><p><span
class='embed-youtube' style='text-align:center; display: block;'><iframe
class='youtube-player' type='text/html' width='770' height='464' src='http://www.youtube.com/embed/PpB-3TwJvQE?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p><p>Any feedback is appreciated in the comments (here, or on youtube).</p><p>kthxbye</p><script type="text/javascript">addthis_url='http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2012%2F03%2F14%2Fwhere-is-mainwindow-xib-in-xcode-4-2%2F';addthis_title='Where+is+MainWindow.xib+in+Xcode+4.2%3F';addthis_pub='';</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script><p><a
href="http://www.trappers.tk/site/?flattrss_redirect&amp;id=399&amp;md5=40525a382802d6bbca267add96dcd72e" title="Flattr" target="_blank"><img
src="http://www.trappers.tk/site/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/jeroentrappers/~4/xP08dbWG-RM" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.trappers.tk/site/2012/03/14/where-is-mainwindow-xib-in-xcode-4-2/feed/</wfw:commentRss> <slash:comments>2</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=jeroentrappers&amp;popout=1&amp;url=http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2012%2F03%2F14%2Fwhere-is-mainwindow-xib-in-xcode-4-2%2F&amp;language=sq_AL&amp;category=text&amp;title=Where+is+MainWindow.xib+in+Xcode+4.2%3F&amp;description=In+one+of+my+previous+posts+I+explained+how+to+create+your+own+MainWindow.xib+User+Interface+Document.+I%26%238217%3Bve+now+also+created+a+screencast+that+guides+you+through+the+process.+It...&amp;tags=blog" type="text/html" /> <feedburner:origLink>http://www.trappers.tk/site/2012/03/14/where-is-mainwindow-xib-in-xcode-4-2/</feedburner:origLink></item> <item><title>Which books to read: Getting started with iOS development</title><link>http://feedproxy.google.com/~r/jeroentrappers/~3/xMeiUOkjp_Q/</link> <comments>http://www.trappers.tk/site/2012/01/31/which-books-to-read-getting-started-with-ios-development/#comments</comments> <pubDate>Tue, 31 Jan 2012 10:12:17 +0000</pubDate> <dc:creator>Jeroen Trappers</dc:creator> <category><![CDATA[apple]]></category><guid isPermaLink="false">http://www.trappers.tk/site/?p=382</guid> <description><![CDATA[In this article I want to give some advice as to which books will help you greatly in getting up to speed on iOS development. I browsed through many books while preparing the iOS development curriculum. First things first: Objective-C By far the best book I&#8217;ve seen is this one: Learning Objective-C 2.0 by Robert&#8230; <a
href="http://www.trappers.tk/site/2012/01/31/which-books-to-read-getting-started-with-ios-development/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>In this article I want to give some advice as to which books will help you greatly in getting up to speed on iOS development. I browsed through many books while preparing the iOS development curriculum.</p><p>First things first: <strong>Objective-C</strong></p><p><img
class="alignright" style="line-height: 24px; font-size: 16px;" title="Learning Objective-C 2.0 - Robert Clair" src="http://www.informit.com/ShowCover.aspx?isbn=0321711386" alt="Book cover: Learning Objective-C 2.0 - Robert Clair " width="180" height="232" /></p><p>By far the best book I&#8217;ve seen is this one: <a
href="http://www.informit.com/store/product.aspx?isbn=0321711386">Learning Objective-C 2.0 by Robert Clair</a>. It covers in depth the programming language you will use to do iOS development. It contains many good and clear examples as well as exercises.</p><p>&nbsp;</p><p><img
class="alignleft" title="Beginning iPhone 4 Development Exploring the iOS SDK" src="http://www.apress.com/media/catalog/product/cache/9/image/9df78eab33525d08d6e5fb8d27136e95/A/9/A9781430230243-3d_9.png" alt="Book cover: Beginning iPhone 4 Development Exploring the iOS SDK" width="277" height="350" />The next thing you will need to get your head around is the <strong>iOS SDK</strong>. I&#8217;ve used two books to learn this. The first book I recommend is <a
href="http://www.apress.com/9781430230243">Beginning iPhone 4 Development</a>.  The book is built in tutorial form while explaining the concepts and introducing the SDK. The examples will bring you up to speed in a very hands-on way. You write lots and lots of code, and I think that is important to get to know the new environment. The book comes with sample code that you can run as well. The version I had used XCode3. That is a big disadvantage, you&#8217;ll still need to find your way around the <a
href="http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40010215">IDE</a> yourself.</p><p><img
class="alignright" title="iOS 4 in Action" src="http://www.manning.com/jharrington/jharrington_cover150.jpg" alt="Book cover: iOS 4 in Action" width="150" height="187" />The second book I recommend is <a
href="http://www.manning.com/jharrington/">iOS 4 in Action</a>. This book is quite high-level, and gives you a good overview of the capabilities that exist. It is not very hands-on however. Some of the examples and sample code are somewhat superficial and only scratch the surface, but nonetheless it is a very pleasant read.</p><p>Another great resource to learn iOS development is the <a
href="http://www.stanford.edu/class/cs193p">Stanford CS193P course on iTunesU</a>. You can watch it for free, and the lector explains in detail, and at a good pace the ins and outs of iOS development. It is not the easiest resource, because it is mainly targeted at the Stanford college students, but once you have a good understanding of the basics, it will get you to a higher level of understanding.</p><p>The other kind of material you should be using all the time is the official apple documentation. The quality of the documentation is great, but it doesn&#8217;t replace the books. This is the real reference material that you need when discovering new and unfamiliar api&#8217;s. There are <a
href="http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007457">some</a> <a
href="http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007072">User</a> <a
href="http://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/Introduction/Introduction.html#//apple_ref/doc/uid/TP40006556">Guides</a> that you should be <a
href="http://developer.apple.com/library/ios/navigation/#section=Resource%20Types&amp;topic=Guides">reading</a>.</p><p>If you don&#8217;t feel like spending too much time reading all these resource, following a training will certainly get you up to speed a lot faster. Seeing an instructor demo the programming language, environment and explaining how to get things done is just a very efficient way to learn.</p><p><strong>Where to go next?</strong></p><p><img
class="alignright" title="Developing Enterprise iOS applications" src="http://akamaicovers.oreilly.com/images/0636920021759/lrg.jpg" alt="Book cover: Developing Enterprise iOS applications" width="180" height="236" />Once you have a good understanding of the technologies and tools to build applications, the next step would be to consider the <a
href="http://shop.oreilly.com/product/0636920021759.do">application development lifecycle</a> and communicating to a back-end with REST+Json services and have a CMS in place to manage the back-end data as well.</p><p>Hope this helps.</p><script type="text/javascript">addthis_url='http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2012%2F01%2F31%2Fwhich-books-to-read-getting-started-with-ios-development%2F';addthis_title='Which+books+to+read%3A+Getting+started+with+iOS+development';addthis_pub='';</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script><p><a
href="http://www.trappers.tk/site/?flattrss_redirect&amp;id=382&amp;md5=b7488388659b6161f636cabbc35be5f7" title="Flattr" target="_blank"><img
src="http://www.trappers.tk/site/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/jeroentrappers/~4/xMeiUOkjp_Q" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.trappers.tk/site/2012/01/31/which-books-to-read-getting-started-with-ios-development/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=jeroentrappers&amp;popout=1&amp;url=http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2012%2F01%2F31%2Fwhich-books-to-read-getting-started-with-ios-development%2F&amp;language=sq_AL&amp;category=text&amp;title=Which+books+to+read%3A+Getting+started+with+iOS+development&amp;description=In+this+article+I+want+to+give+some+advice+as+to+which+books+will+help+you+greatly+in+getting+up+to+speed+on+iOS+development.+I+browsed+through+many+books...&amp;tags=blog" type="text/html" /> <feedburner:origLink>http://www.trappers.tk/site/2012/01/31/which-books-to-read-getting-started-with-ios-development/</feedburner:origLink></item> <item><title>MainWindow.xib</title><link>http://feedproxy.google.com/~r/jeroentrappers/~3/FLKqP7SsnTo/</link> <comments>http://www.trappers.tk/site/2011/06/16/mainwindow-xib/#comments</comments> <pubDate>Thu, 16 Jun 2011 19:17:02 +0000</pubDate> <dc:creator>Jeroen Trappers</dc:creator> <category><![CDATA[apple]]></category><guid isPermaLink="false">http://www.trappers.tk/site/?p=324</guid> <description><![CDATA[[Update: I added a screencast of the process] [Update: Interesting discussion of this post over on StackOverflow] In the XCode 4.2 beta, MainWindow.xib is no longer included by default in some project templates. This means that you have to get your application to work by writing some code, using another method, or by manually reconstructing&#8230; <a
href="http://www.trappers.tk/site/2011/06/16/mainwindow-xib/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><strong>[Update: I added a <a
title="Where is MainWindow.xib in Xcode 4.2?" href="http://www.trappers.tk/site/2012/03/14/where-is-mainwindow-xib-in-xcode-4-2/">screencast </a>of the process]</strong></p><p><strong>[Update: Interesting discussion of this post over on <a
href="http://stackoverflow.com/questions/7368876/how-to-hookup-a-mainwindow-xib-to-an-empty-project">StackOverflow</a>]</strong></p><p>In the XCode 4.2 beta, MainWindow.xib is no longer included by default in some project templates. This means that you have to get your application to work by writing some code, using another method, or by manually reconstructing MainWindow.xib. This post shows the latter. Let&#8217;s get started.</p><p><img
class="size-full wp-image-332 alignright" title="Start with Empty Application template" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-1.png" alt="Start with Empty Application template" width="492" height="99" /></p><p>If you create a new project in XCode 4.2 beta, and choose the Empty Application template to start from, change nothing and try running it in your iPhone 5.0 simulator, you will see an empty &#8211; black &#8211; screen. The only thing you get from the template is an <em>xAppDelegate.h</em> and <em>.m</em>.</p><p>We will now reconstruct our own MainWindow.xib, to get started with development the way you&#8217;re used to. So the next thing we do is add a New File to the project. Choose <em>iOS &gt; User Interface &gt; Empty</em> as template. <img
class="alignright size-full wp-image-333" title="Add Empty Interface Builder document" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-2.png" alt="Add Empty Interface Builder document" width="325" height="85" />Next, choose iPhone, next give it the name <em>MainWindow</em> (.xib will be added automatically). By the way, the name of the file is not very important, but it&#8217;s nice to choose <em>MainWindow</em>, because that&#8217;s familiar.</p><p>Select the new File we just created. What we have now is an empty design surface, in what used to be Interface Builder. Here we&#8217;re going to change some things.</p><p><img
class="alignright size-full wp-image-334" title="The empty design surface of MainWindow.xib" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-3.png" alt="The empty design surface of MainWindow.xib" width="940" height="508" /></p><ul><li>Change the class of File&#8217;s Owner to UIApplication</li></ul><p><img
class="size-full wp-image-335 alignright" title="Change class of File's Owner to UIApplication" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-4.png" alt="Change class of File's Owner to UIApplication" width="641" height="176" /></p><ul><li>Find Object in the Library and drag it onto the Objects pane on the left.</li></ul><p><span
style="font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;"><img
class="alignright size-full wp-image-336" title="Add Object to the document" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-5.png" alt="Add Object to the document" width="638" height="300" /></span></p><ul><li>Change the class of that Object to the xAppDelegate class that was created by the template, you might also want to clear out the &#8220;Object&#8221; label.</li></ul><p><span
style="font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;"><img
class="alignright size-full wp-image-337" title="Change class of the object to xAppDelegate" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-6.png" alt="Change class of the object to xAppDelegate" width="635" height="298" /></span></p><ul><li>Add a Window to the Objects pane on the left.</li></ul><p><span
style="font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;"><img
class="size-full wp-image-338 alignnone" title="Add a window to the document" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-7.png" alt="Add a window to the document" width="639" height="380" /></span></p><p><span
style="font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;">Now, let&#8217;s bind it all together. To do this, we first need to change some of the code in the xAppDelegate.h. We have to add IBOutlet to the window property it has, so that we can  hook it up in Interface Builder. The xAppDelegate.h should read something like this:</span></p><pre>@interface DemoAppDelegate :
      UIResponder &lt;UIApplicationDelegate&gt;
@property (strong, nonatomic) <em><strong>IBOutlet</strong></em> UIWindow *window;
@end</pre><p>Don&#8217;t forget to <strong>save</strong> the file, otherwise Interface Builder will not be able to pick up the Outlet. Next we continue editing the MainWindow.xib</p><ul><li>Control-Drag from the <em>delegate</em> outlet of the File Owner to the xAppDelegate object.</li></ul><p><span
style="font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;"><img
class="alignright size-full wp-image-339" title="Link the application delegate" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-8.png" alt="Link the application delegate" width="641" height="210" /></span></p><ul><li>Control-Drag from the <em>window</em> outlet of the xAppDelegate to the Window.</li></ul><p><span
style="font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;"><img
class="alignright size-full wp-image-340" title="Link the window outlet of the app delegate" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-9.png" alt="Link the window outlet of the app delegate" width="639" height="187" /></span></p><ul><li>Just for this demo, I&#8217;m adding a label to the window.</li></ul><p><span
style="font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;"><img
class="alignright size-full wp-image-341" title="Add a label for testing" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-10.png" alt="Add a label for testing" width="697" height="360" /></span></p><p>We&#8217;re not done yet, but we&#8217;re almost there.</p><ul><li>Navigate to the project, and in the Summary tab, select MainWindow as the Main Interface.</li></ul><p><span
style="font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;"><a
href="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-11.png"><img
class="size-full wp-image-342 alignnone" title="Set the Main Interface to MainWindow" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-11.png" alt="Set the Main Interface to MainWindow" width="849" height="262" /></a></span></p><p>You can now run the project in the Simulator, and the window should show up. However there&#8217;s one last thing you might want to clean up. In <em>xAppDelegate.m</em>, there was actually code that creates a window as well. Just put the method</p><pre>- (BOOL) application:didFinishLaunchingWithOptions:</pre><p>in comment.</p><p><img
class="alignright size-full wp-image-360" title="we're done" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-12.png" alt="we're done" width="380" height="264" /></p><p>&nbsp;</p><p>&nbsp;</p><p>I hope this helps to understand exactly how an iOS app starts. The next thing you should do is add a ViewController, and push it onto the MainWindow. I&#8217;m not going to cover that here. Please leave your feedback in the comments.</p><p>kthxbye</p><script type="text/javascript">addthis_url='http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2011%2F06%2F16%2Fmainwindow-xib%2F';addthis_title='MainWindow.xib';addthis_pub='';</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script><p><a
href="http://www.trappers.tk/site/?flattrss_redirect&amp;id=324&amp;md5=6f7ca5b2a89e1f3092bf1f047954f543" title="Flattr" target="_blank"><img
src="http://www.trappers.tk/site/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/jeroentrappers/~4/FLKqP7SsnTo" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.trappers.tk/site/2011/06/16/mainwindow-xib/feed/</wfw:commentRss> <slash:comments>67</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=jeroentrappers&amp;popout=1&amp;url=http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2011%2F06%2F16%2Fmainwindow-xib%2F&amp;language=sq_AL&amp;category=text&amp;title=MainWindow.xib&amp;description=%5BUpdate%3A+I+added+a+screencast+of+the+process%5D+%5BUpdate%3A+Interesting+discussion+of+this+post+over+on+StackOverflow%5D+In+the+XCode+4.2+beta%2C+MainWindow.xib+is+no+longer+included+by+default+in...&amp;tags=blog" type="text/html" /> <feedburner:origLink>http://www.trappers.tk/site/2011/06/16/mainwindow-xib/</feedburner:origLink></item> <item><title>Apple: iOS5</title><link>http://feedproxy.google.com/~r/jeroentrappers/~3/_JuOe5VziXI/</link> <comments>http://www.trappers.tk/site/2011/06/06/apple-u2u-ios5/#comments</comments> <pubDate>Mon, 06 Jun 2011 20:09:51 +0000</pubDate> <dc:creator>Jeroen</dc:creator> <category><![CDATA[apple]]></category><guid isPermaLink="false">http://www.trappers.tk/site/?p=320</guid> <description><![CDATA[I&#8217;m currently watching the keynote video stream of the WWDC 2011 event that is going on right now. Will need to update my skills to learn to take advantage of the new iOS5 features. Looks very interesting!]]></description> <content:encoded><![CDATA[<p>I&#8217;m currently watching the <a
href="http://www.apple.com/apple-events/">keynote video stream</a> of the WWDC 2011 event that is going on right now. Will need to update my skills to learn to take advantage of the new <a
href="http://www.apple.com/ios/ios5/features.html">iOS5 features</a>. Looks very interesting!</p><p><a
href="http://www.trappers.tk/site/wp-content/uploads/2011/06/Screen-shot-2011-06-06-at-22.05.08.png"><img
class="aligncenter size-full wp-image-321" title="Screen shot 2011-06-06 at 22.05.08" src="http://www.trappers.tk/site/wp-content/uploads/2011/06/Screen-shot-2011-06-06-at-22.05.08.png" alt="" width="567" height="230" /></a></p><script type="text/javascript">addthis_url='http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2011%2F06%2F06%2Fapple-u2u-ios5%2F';addthis_title='Apple%3A+iOS5';addthis_pub='';</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script><p><a
href="http://www.trappers.tk/site/?flattrss_redirect&amp;id=320&amp;md5=a92e7b14e207dcea0e7f677cfe73fb47" title="Flattr" target="_blank"><img
src="http://www.trappers.tk/site/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/jeroentrappers/~4/_JuOe5VziXI" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.trappers.tk/site/2011/06/06/apple-u2u-ios5/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=jeroentrappers&amp;popout=1&amp;url=http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2011%2F06%2F06%2Fapple-u2u-ios5%2F&amp;language=sq_AL&amp;category=text&amp;title=Apple%3A+iOS5&amp;description=I%26%238217%3Bm+currently+watching+the+keynote+video+stream+of+the+WWDC+2011+event+that+is+going+on+right+now.+Will+need+to+update+my+skills+to+learn+to%C2%A0take+advantage+of+the...&amp;tags=blog" type="text/html" /> <feedburner:origLink>http://www.trappers.tk/site/2011/06/06/apple-u2u-ios5/</feedburner:origLink></item> <item><title>Windows Azure SDK for iOS</title><link>http://feedproxy.google.com/~r/jeroentrappers/~3/MlywhzuzeXQ/</link> <comments>http://www.trappers.tk/site/2011/05/10/apple-u2u-windows-azure-sdk-for-ios/#comments</comments> <pubDate>Tue, 10 May 2011 12:45:44 +0000</pubDate> <dc:creator>Jeroen Trappers</dc:creator> <category><![CDATA[apple]]></category><guid isPermaLink="false">http://www.trappers.tk/site/?p=311</guid> <description><![CDATA[Yesterday Microsoft announced the availability of an iOS specific SDK for Azure development. It&#8217;s great to see that Microsoft is supporting iOS devices. Recently also iOS support for the Bing Maps API had been announced. There&#8217;s great momentum going on. The ideal time to jump on the train. Find the original announcement on the Official&#8230; <a
href="http://www.trappers.tk/site/2011/05/10/apple-u2u-windows-azure-sdk-for-ios/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Yesterday Microsoft announced the availability of an iOS specific SDK for Azure development.</p><p><a
href="http://www.trappers.tk/site/wp-content/uploads/2011/05/azureIphone.png"><img
class="alignleft size-full wp-image-312" title="azureIphone" src="http://www.trappers.tk/site/wp-content/uploads/2011/05/azureIphone.png" alt="" width="179" height="336" /></a><a
href="http://www.trappers.tk/site/wp-content/uploads/2011/05/BlobStorageIPhone.png"><img
class="alignleft size-full wp-image-313" title="BlobStorageIPhone" src="http://www.trappers.tk/site/wp-content/uploads/2011/05/BlobStorageIPhone.png" alt="" width="179" height="336" /></a></p><p>It&#8217;s great to see that Microsoft is supporting iOS devices. Recently also iOS support for the <a
href="http://www.bing.com/community/site_blogs/b/maps/archive/2011/05/05/new-bing-maps-ios-sdk.aspx">Bing Maps API</a> had been announced. There&#8217;s great momentum going on. The ideal time to jump on the train.</p><p>Find the original announcement on the <a
href="http://blogs.technet.com/b/microsoft_blog/archive/2011/05/09/microsoft-announces-windows-azure-toolkits-for-ios-android-and-windows-phone.aspx">Official Microsoft Blog</a>.</p><p>You can get the Windows Azure Toolkit for iOS &#8211; even <strong>all the source code</strong> &#8211; on <a
href="https://github.com/microsoft-dpe">github</a>.</p><p><strong>Update</strong>: the easiest way &#8212; in my opinion &#8212; to consume the RestFull Azure API&#8217;s is using <a
href="http://restkit.org/">RestKit</a>.</p><script type="text/javascript">addthis_url='http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2011%2F05%2F10%2Fapple-u2u-windows-azure-sdk-for-ios%2F';addthis_title='Windows+Azure+SDK+for+iOS';addthis_pub='';</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script><p><a
href="http://www.trappers.tk/site/?flattrss_redirect&amp;id=311&amp;md5=f26ac9e93b59bf8091b0015dc1764870" title="Flattr" target="_blank"><img
src="http://www.trappers.tk/site/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/jeroentrappers/~4/MlywhzuzeXQ" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.trappers.tk/site/2011/05/10/apple-u2u-windows-azure-sdk-for-ios/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=jeroentrappers&amp;popout=1&amp;url=http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2011%2F05%2F10%2Fapple-u2u-windows-azure-sdk-for-ios%2F&amp;language=sq_AL&amp;category=text&amp;title=Windows+Azure+SDK+for+iOS&amp;description=Yesterday+Microsoft+announced+the+availability+of+an+iOS+specific+SDK+for+Azure+development.+It%26%238217%3Bs+great+to+see+that+Microsoft+is+supporting+iOS+devices.+Recently+also+iOS+support+for+the+Bing...&amp;tags=blog" type="text/html" /> <feedburner:origLink>http://www.trappers.tk/site/2011/05/10/apple-u2u-windows-azure-sdk-for-ios/</feedburner:origLink></item> <item><title>Fullscreen background plugin now in WordPress repository</title><link>http://feedproxy.google.com/~r/jeroentrappers/~3/uVuqbFj6VnY/</link> <comments>http://www.trappers.tk/site/2011/03/30/fullscreen-background-plugin-now-in-wordpress-repository/#comments</comments> <pubDate>Wed, 30 Mar 2011 21:00:29 +0000</pubDate> <dc:creator>Jeroen</dc:creator> <category><![CDATA[tinternet]]></category><guid isPermaLink="false">http://www.trappers.tk/site/?p=304</guid> <description><![CDATA[I finally took the time to put the plugin I wrote in the wordpress plugin repository. This makes it even easier to set it up on your Blog. Simply go to the administration area of your blog, go to the Plugins section and click Add New. There you search for &#8220;Full screen background&#8221; and normally&#8230; <a
href="http://www.trappers.tk/site/2011/03/30/fullscreen-background-plugin-now-in-wordpress-repository/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I finally took the time to put <a
title="Full screen background / wallpaper plugin for wordpress" href="http://www.trappers.tk/site/2011/03/07/full-screen-background-wallpaper-plugin-for-wordpress/">the plugin I wrote</a> in the wordpress plugin repository. This makes it even easier to set it up on your Blog.</p><p>Simply go to the administration area of your blog, go to the Plugins section and click Add New. There you search for &#8220;Full screen background&#8221; and normally the first hit should be my plugin.</p><p><a
href="http://www.trappers.tk/site/wp-content/uploads/2011/03/fullbg.png"><img
class="aligncenter size-full wp-image-305" title="fullbg" src="http://www.trappers.tk/site/wp-content/uploads/2011/03/fullbg.png" alt="" width="607" height="243" /></a></p><p>The next step is to activate it, and change the image you want to show. You do this by editing one line in the source of the plugin. You can do this by clicking the Edit link next to the plugin in the list of active plugins. The line you have to change is indicated with a html comment. Change the src attribute of the img element. That&#8217;s it.</p><p>Please provide feedback if it works or doesn&#8217;t work for you. Thanks!</p><script type="text/javascript">addthis_url='http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2011%2F03%2F30%2Ffullscreen-background-plugin-now-in-wordpress-repository%2F';addthis_title='Fullscreen+background+plugin+now+in+WordPress+repository';addthis_pub='';</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script><p><a
href="http://www.trappers.tk/site/?flattrss_redirect&amp;id=304&amp;md5=61f9ef3c2f0cf6b4ed0557ccb7a4ac23" title="Flattr" target="_blank"><img
src="http://www.trappers.tk/site/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/jeroentrappers/~4/uVuqbFj6VnY" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.trappers.tk/site/2011/03/30/fullscreen-background-plugin-now-in-wordpress-repository/feed/</wfw:commentRss> <slash:comments>12</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=jeroentrappers&amp;popout=1&amp;url=http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2011%2F03%2F30%2Ffullscreen-background-plugin-now-in-wordpress-repository%2F&amp;language=en_GB&amp;category=text&amp;title=Fullscreen+background+plugin+now+in+WordPress+repository&amp;description=I+finally+took+the+time+to+put+the+plugin+I+wrote+in+the+wordpress+plugin+repository.+This+makes+it+even+easier+to+set+it+up+on+your+Blog.+Simply+go...&amp;tags=blog" type="text/html" /> <feedburner:origLink>http://www.trappers.tk/site/2011/03/30/fullscreen-background-plugin-now-in-wordpress-repository/</feedburner:origLink></item> <item><title>Telenet Fibernet40 local network Topology</title><link>http://feedproxy.google.com/~r/jeroentrappers/~3/Qy8LIChvPLs/</link> <comments>http://www.trappers.tk/site/2011/03/16/telenet-fibernet40-local-network-topology/#comments</comments> <pubDate>Wed, 16 Mar 2011 21:30:39 +0000</pubDate> <dc:creator>Jeroen Trappers</dc:creator> <category><![CDATA[tinternet]]></category><guid isPermaLink="false">http://www.trappers.tk/site/?p=290</guid> <description><![CDATA[A while ago, I wrote about my VLAN setup for the Telenet local network. Today, Bert, the Telenet technician came in for a modem-swap, and activated Fibernet40 on my subscription. It is the same price as the older &#8220;Gold-Shake&#8221; that we had, but you get a lot more bang for your buck: 100GB limit instead&#8230; <a
href="http://www.trappers.tk/site/2011/03/16/telenet-fibernet40-local-network-topology/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>A while ago, I <a
href="http://www.trappers.tk/site/2009/06/14/new-network-topology-with-vlan-telenet-digicorder-wifi-1-device/">wrote</a> about my VLAN setup for the Telenet local network.</p><p>Today, Bert, the Telenet technician came in for a modem-swap, and activated Fibernet40 on my subscription. It is the same price as the older &#8220;Gold-Shake&#8221; that we had, but you get a lot more bang for your buck: 100GB limit instead of 60GB and 40Mbps instead of 10Mbps download speed. (and some other extra&#8217;s)</p><p>Another advantage is that now they installed a Modem with integrated Wireless router and wired switch. So my old-setup is now obsolete. This is the new topology:</p> <figure
id="attachment_291" class="wp-caption thumbnail alignnone" style="width: 483px;"> <img
class="size-full wp-image-291" title="Telenet Fibernet40 with wifi setup" src="http://www.trappers.tk/site/wp-content/uploads/2011/03/telenetwifi.png" alt="" width="483" height="464" /> <figcaption
class="wp-caption-text">New network topology. Blue lines are Coax, Purple ethernet, Green: HDMI</figcaption> </figure><p>So it eliminated the use of an extra router in my home, it is actually built into the modem itself. It supports 802.11N, so it is way faster than the one I had. The speed is really great!</p><p>In my home, I&#8217;m using 200Mbps Powerline Ethernet boxes to transmit the signal without the need for other cables. I have a switch under the tv, to get network to my XBox, I have another switch in the other corner of the room to get the network to my printer and PC. The laptops use wifi (duh) at equal speed as the wired network.</p><p>I don&#8217;t really understand yet how Telenet actually achieves this setup, because devices behind the modem get an internal IP, in the 198.168.0.* range, while the digicorder still gets an IP in the 10.166.179.* range. I should sniff my local network to really know what is going on. I will do that if I have a little bit more time. For the moment I&#8217;m just enjoying the Internet in high speed.</p> <figure
id="attachment_292" class="wp-caption thumbnail alignnone" style="width: 654px;"> <a
href="http://speedtest.telenet.be"><img
class="size-full wp-image-292" title="Fibernet40" src="http://www.trappers.tk/site/wp-content/uploads/2011/03/Fibernet40.png" alt="Do the test yourself at http://speedtest.telenet.be" width="654" height="515" /></a> <figcaption
class="wp-caption-text">Do the test yourself at http://speedtest.telenet.be</figcaption> </figure><p>Note that the managment UI for the modem is reached through <a
href="http://mijn.telenet.be">mijn.telenet.be</a>, which is kind of nice. This means that they can remotely manage my modem/router. I don&#8217;t really mind doing that myself, but it&#8217;s nice to know they can help less knowledgeable users.</p><p><a
title="telenet" href="http://www.telenet.be"><img
class="alignleft size-full wp-image-293" title="logo_telenet" src="http://www.trappers.tk/site/wp-content/uploads/2011/03/logo_telenet.png" alt="" width="72" height="73" /></a>So don&#8217;t sit around, pick up the phone and make an appointment with Telenet today, to upgrade your internet experience for free. I didn&#8217;t have to pay activation or installation costs at all!</p><script type="text/javascript">addthis_url='http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2011%2F03%2F16%2Ftelenet-fibernet40-local-network-topology%2F';addthis_title='Telenet+Fibernet40+local+network+Topology';addthis_pub='';</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script><p><a
href="http://www.trappers.tk/site/?flattrss_redirect&amp;id=290&amp;md5=5547e3181dab1f604691bb4fc9692257" title="Flattr" target="_blank"><img
src="http://www.trappers.tk/site/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/jeroentrappers/~4/Qy8LIChvPLs" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.trappers.tk/site/2011/03/16/telenet-fibernet40-local-network-topology/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=jeroentrappers&amp;popout=1&amp;url=http%3A%2F%2Fwww.trappers.tk%2Fsite%2F2011%2F03%2F16%2Ftelenet-fibernet40-local-network-topology%2F&amp;language=en_GB&amp;category=text&amp;title=Telenet+Fibernet40+local+network+Topology&amp;description=A+while+ago%2C+I+wrote+about+my+VLAN+setup+for+the+Telenet+local+network.+Today%2C+Bert%2C+the+Telenet+technician+came+in+for+a+modem-swap%2C+and+activated+Fibernet40+on+my+subscription....&amp;tags=blog" type="text/html" /> <feedburner:origLink>http://www.trappers.tk/site/2011/03/16/telenet-fibernet40-local-network-topology/</feedburner:origLink></item> </channel> </rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 1785/1915 objects using disk: basic

 Served from: www.trappers.tk @ 2013-05-21 19:32:22 by W3 Total Cache -->
