<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Appmire blog</title>
	<atom:link href="https://www.trappers.tk/site/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.trappers.tk/site/</link>
	<description>www.appmire.be</description>
	<lastBuildDate>Sun, 04 Aug 2013 10:02:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">24445754</site>	<item>
		<title>Debug Exception in Xcode</title>
		<link>https://www.trappers.tk/site/2013/08/01/debug-exception-in-xcode/</link>
					<comments>https://www.trappers.tk/site/2013/08/01/debug-exception-in-xcode/#respond</comments>
		
		<dc:creator><![CDATA[Jeroen]]></dc:creator>
		<pubDate>Thu, 01 Aug 2013 14:14:14 +0000</pubDate>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[technologie]]></category>
		<category><![CDATA[tinternet]]></category>
		<guid isPermaLink="false">http://www.trappers.tk/site/?p=497</guid>

					<description><![CDATA[<p>Debugging exception information in Xcode with lldb. Print in the command window. <a href="https://www.trappers.tk/site/2013/08/01/debug-exception-in-xcode/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2013/08/01/debug-exception-in-xcode/">Debug Exception in Xcode</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes it happens that Xcode throws you an exception, and you don&#8217;t know why. How do you print the relevant Exception information?</p>
<p>To get more information, you can configure the debugger to break when any exception is thrown. Go to the Breakpoint Navigator and click the little &#8216;+&#8217;-button at the bottom. Then click &#8220;Add Exception Breakpoint&#8221;.</p>
<p style="text-align: left;"><img decoding="async" class="size-full wp-image-499 aligncenter" alt="Add Exception Breakpoint" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2013/08/Screen-Shot-2013-08-01-at-15.55.29.png?resize=415%2C476" width="415" height="476" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2013/08/Screen-Shot-2013-08-01-at-15.55.29.png?w=415&amp;ssl=1 415w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2013/08/Screen-Shot-2013-08-01-at-15.55.29.png?resize=261%2C300&amp;ssl=1 261w" sizes="(max-width: 415px) 100vw, 415px" data-recalc-dims="1" />But, in many cases, even then you don&#8217;t get the information you wanted when the Exception occurs. Add these commands to the breakpoint configuration to show the name and reason of the breakpoint. This should get you on the way to eliminate the error.</p>
<p><img decoding="async" loading="lazy" class="size-full wp-image-498 alignright" alt="Breakpoint on all exceptions" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2013/08/Screen-Shot-2013-08-01-at-15.44.37.png?resize=560%2C266" width="560" height="266" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2013/08/Screen-Shot-2013-08-01-at-15.44.37.png?w=560&amp;ssl=1 560w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2013/08/Screen-Shot-2013-08-01-at-15.44.37.png?resize=300%2C142&amp;ssl=1 300w" sizes="(max-width: 560px) 100vw, 560px" data-recalc-dims="1" /></p>
<p><strong>po [*(id *)($esp+4) name]</strong> and</p>
<p><strong>po [*(id *)($esp+4) reason]</strong></p>
<p>&nbsp;</p>
<p>This works when you are using LLDB by printing the name and reason of the exception in the command window. You can also execute those commands in the command window, but you have to make sure to select stackframe 0 first.</p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2013/08/01/debug-exception-in-xcode/">Debug Exception in Xcode</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trappers.tk/site/2013/08/01/debug-exception-in-xcode/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">497</post-id>	</item>
		<item>
		<title>Strongly typed Table View Cells to make your life easier</title>
		<link>https://www.trappers.tk/site/2012/05/19/strongly-typed-table-view-cells-to-make-your-life-easier/</link>
					<comments>https://www.trappers.tk/site/2012/05/19/strongly-typed-table-view-cells-to-make-your-life-easier/#respond</comments>
		
		<dc:creator><![CDATA[Jeroen]]></dc:creator>
		<pubDate>Sat, 19 May 2012 06:03:11 +0000</pubDate>
				<category><![CDATA[apple]]></category>
		<guid isPermaLink="false">http://www.trappers.tk/site/?p=432</guid>

					<description><![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. We&#8230; <a href="https://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></p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2012/05/19/strongly-typed-table-view-cells-to-make-your-life-easier/">Strongly typed Table View Cells to make your life easier</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></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 decoding="async" loading="lazy" class="alignright size-full wp-image-451" title="step 1" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-1.png?resize=535%2C113" alt="" width="535" height="113" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-1.png?w=535&amp;ssl=1 535w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-1.png?resize=300%2C63&amp;ssl=1 300w" sizes="(max-width: 535px) 100vw, 535px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-2.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-463" title="step 2" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-2.png?resize=518%2C218" alt="" width="518" height="218" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-2.png?w=518&amp;ssl=1 518w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-2.png?resize=300%2C126&amp;ssl=1 300w" sizes="(max-width: 518px) 100vw, 518px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-3.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-464" title="step 3" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-3.png?resize=736%2C605" alt="" width="736" height="605" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-3.png?w=736&amp;ssl=1 736w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-3.png?resize=300%2C246&amp;ssl=1 300w" sizes="(max-width: 736px) 100vw, 736px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-4.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-465" title="step 4" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-4.png?resize=632%2C312" alt="" width="632" height="312" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-4.png?w=632&amp;ssl=1 632w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-4.png?resize=300%2C148&amp;ssl=1 300w" sizes="(max-width: 632px) 100vw, 632px" data-recalc-dims="1" /></a><a href="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-5.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-466" title="step 5" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-5.png?resize=487%2C177" alt="" width="487" height="177" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-5.png?w=487&amp;ssl=1 487w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-5.png?resize=300%2C109&amp;ssl=1 300w" sizes="(max-width: 487px) 100vw, 487px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-6.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-467" title="step 6" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-6.png?resize=293%2C103" alt="" width="293" height="103" data-recalc-dims="1" /></a><a href="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-7.png"><img decoding="async" loading="lazy" class="size-full wp-image-468 alignnone" title="step 7" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-7.png?resize=522%2C113" alt="" width="522" height="113" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-7.png?w=522&amp;ssl=1 522w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-7.png?resize=300%2C64&amp;ssl=1 300w" sizes="(max-width: 522px) 100vw, 522px" data-recalc-dims="1" /></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 ;-)):</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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-8.png"><img decoding="async" loading="lazy" class="size-full wp-image-452 aligncenter" title="step 8" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-8.png?resize=379%2C741" alt="" width="379" height="741" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-8.png?w=379&amp;ssl=1 379w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-8.png?resize=153%2C300&amp;ssl=1 153w" sizes="(max-width: 379px) 100vw, 379px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-9.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-453" title="step 9" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-9.png?resize=518%2C71" alt="" width="518" height="71" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-9.png?w=518&amp;ssl=1 518w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-9.png?resize=300%2C41&amp;ssl=1 300w" sizes="(max-width: 518px) 100vw, 518px" data-recalc-dims="1" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><img decoding="async" loading="lazy" class="alignright size-full wp-image-454" title="step 10" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-10.png?resize=351%2C85" alt="" width="351" height="85" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-10.png?w=351&amp;ssl=1 351w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-10.png?resize=300%2C72&amp;ssl=1 300w" sizes="(max-width: 351px) 100vw, 351px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-11.png"><img decoding="async" loading="lazy" class="alignnone size-full wp-image-469" title="step 11" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-11.png?resize=348%2C57" alt="" width="348" height="57" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-11.png?w=348&amp;ssl=1 348w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-11.png?resize=300%2C49&amp;ssl=1 300w" sizes="(max-width: 348px) 100vw, 348px" data-recalc-dims="1" /></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 decoding="async" loading="lazy" class="alignright size-full wp-image-455" title="step 13" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-13.png?resize=374%2C142" alt="" width="374" height="142" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-13.png?w=374&amp;ssl=1 374w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-13.png?resize=300%2C113&amp;ssl=1 300w" sizes="(max-width: 374px) 100vw, 374px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-14.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-471" title="step 14" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-14.png?resize=682%2C218" alt="" width="682" height="218" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-14.png?w=682&amp;ssl=1 682w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-14.png?resize=300%2C95&amp;ssl=1 300w" sizes="(max-width: 682px) 100vw, 682px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-201.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-480" title="step 20" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-201.png?resize=246%2C99" alt="" width="246" height="99" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-15.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-456" title="step 15" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-15.png?resize=689%2C161" alt="" width="689" height="161" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-15.png?w=689&amp;ssl=1 689w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-15.png?resize=300%2C70&amp;ssl=1 300w" sizes="(max-width: 689px) 100vw, 689px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-16.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-457" title="step 16" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-16.png?resize=684%2C172" alt="" width="684" height="172" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-16.png?w=684&amp;ssl=1 684w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-16.png?resize=300%2C75&amp;ssl=1 300w" sizes="(max-width: 684px) 100vw, 684px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-17.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-472" title="step 17" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-17.png?resize=770%2C197" alt="" width="770" height="197" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-17.png?w=916&amp;ssl=1 916w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-17.png?resize=300%2C76&amp;ssl=1 300w" sizes="(max-width: 770px) 100vw, 770px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-18.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-473" title="step 18" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-18.png?resize=770%2C357" alt="" width="770" height="357" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-18.png?w=895&amp;ssl=1 895w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-18.png?resize=300%2C139&amp;ssl=1 300w" sizes="(max-width: 770px) 100vw, 770px" data-recalc-dims="1" /></a></p>
<p><img decoding="async" loading="lazy" class="alignright size-full wp-image-458" title="step 19" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-19.png?resize=625%2C242" alt="" width="625" height="242" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-19.png?w=625&amp;ssl=1 625w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-19.png?resize=300%2C116&amp;ssl=1 300w" sizes="(max-width: 625px) 100vw, 625px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-21.png"><img decoding="async" loading="lazy" class="size-full wp-image-460 aligncenter" title="step 21" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-21.png?resize=329%2C490" alt="" width="329" height="490" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-21.png?w=329&amp;ssl=1 329w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-21.png?resize=201%2C300&amp;ssl=1 201w" sizes="(max-width: 329px) 100vw, 329px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-22.png"><img decoding="async" loading="lazy" class="alignright size-full wp-image-461" title="step 22" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-22.png?resize=261%2C49" alt="" width="261" height="49" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-23.png"><img decoding="async" loading="lazy" class="size-full wp-image-462 aligncenter" title="step 23" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-23.png?resize=389%2C746" alt="" width="389" height="746" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-23.png?w=389&amp;ssl=1 389w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/step-23.png?resize=156%2C300&amp;ssl=1 156w" sizes="(max-width: 389px) 100vw, 389px" data-recalc-dims="1" /></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>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2012/05/19/strongly-typed-table-view-cells-to-make-your-life-easier/">Strongly typed Table View Cells to make your life easier</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://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>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">432</post-id>	</item>
		<item>
		<title>Face detection with Core Image on Live Video</title>
		<link>https://www.trappers.tk/site/2012/05/02/face-detection-with-core-image-on-live-video/</link>
					<comments>https://www.trappers.tk/site/2012/05/02/face-detection-with-core-image-on-live-video/#comments</comments>
		
		<dc:creator><![CDATA[Jeroen]]></dc:creator>
		<pubDate>Wed, 02 May 2012 15:28:07 +0000</pubDate>
				<category><![CDATA[apple]]></category>
		<guid isPermaLink="false">http://www.trappers.tk/site/?p=410</guid>

					<description><![CDATA[<p>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="https://www.trappers.tk/site/2012/05/02/face-detection-with-core-image-on-live-video/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2012/05/02/face-detection-with-core-image-on-live-video/">Face detection with Core Image on Live Video</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/IMG_0097.png"><img decoding="async" loading="lazy" class="alignright size-medium wp-image-424" title="Mustachio" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/IMG_0097-200x300.png?resize=200%2C300" alt="" width="200" height="300" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/IMG_0097.png?resize=200%2C300&amp;ssl=1 200w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2012/05/IMG_0097.png?w=320&amp;ssl=1 320w" sizes="(max-width: 200px) 100vw, 200px" data-recalc-dims="1" /></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>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2012/05/02/face-detection-with-core-image-on-live-video/">Face detection with Core Image on Live Video</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trappers.tk/site/2012/05/02/face-detection-with-core-image-on-live-video/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">410</post-id>	</item>
		<item>
		<title>Where is MainWindow.xib in Xcode 4.2?</title>
		<link>https://www.trappers.tk/site/2012/03/14/where-is-mainwindow-xib-in-xcode-4-2/</link>
					<comments>https://www.trappers.tk/site/2012/03/14/where-is-mainwindow-xib-in-xcode-4-2/#comments</comments>
		
		<dc:creator><![CDATA[Jeroen]]></dc:creator>
		<pubDate>Wed, 14 Mar 2012 21:09:25 +0000</pubDate>
				<category><![CDATA[apple]]></category>
		<guid isPermaLink="false">http://www.trappers.tk/site/?p=399</guid>

					<description><![CDATA[<p>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="https://www.trappers.tk/site/2012/03/14/where-is-mainwindow-xib-in-xcode-4-2/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2012/03/14/where-is-mainwindow-xib-in-xcode-4-2/">Where is MainWindow.xib in Xcode 4.2?</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></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><iframe loading="lazy" class="youtube-player" width="770" height="434" src="https://www.youtube.com/embed/PpB-3TwJvQE?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation"></iframe></p>
<p>Any feedback is appreciated in the comments (here, or on youtube).</p>
<p>kthxbye</p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2012/03/14/where-is-mainwindow-xib-in-xcode-4-2/">Where is MainWindow.xib in Xcode 4.2?</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trappers.tk/site/2012/03/14/where-is-mainwindow-xib-in-xcode-4-2/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">399</post-id>	</item>
		<item>
		<title>Which books to read: Getting started with iOS development</title>
		<link>https://www.trappers.tk/site/2012/01/31/which-books-to-read-getting-started-with-ios-development/</link>
					<comments>https://www.trappers.tk/site/2012/01/31/which-books-to-read-getting-started-with-ios-development/#respond</comments>
		
		<dc:creator><![CDATA[Jeroen]]></dc:creator>
		<pubDate>Tue, 31 Jan 2012 10:12:17 +0000</pubDate>
				<category><![CDATA[apple]]></category>
		<guid isPermaLink="false">http://www.trappers.tk/site/?p=382</guid>

					<description><![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. 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="https://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></p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2012/01/31/which-books-to-read-getting-started-with-ios-development/">Which books to read: Getting started with iOS development</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></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 decoding="async" loading="lazy" 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 decoding="async" loading="lazy" class="alignleft" title="Beginning iPhone 4 Development Exploring the iOS SDK" src="https://i0.wp.com/www.apress.com/media/catalog/product/cache/9/image/9df78eab33525d08d6e5fb8d27136e95/A/9/A9781430230243-3d_9.png?resize=277%2C350" alt="Book cover: Beginning iPhone 4 Development Exploring the iOS SDK" width="277" height="350" data-recalc-dims="1" />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 decoding="async" loading="lazy" class="alignright" title="iOS 4 in Action" src="https://i0.wp.com/www.manning.com/jharrington/jharrington_cover150.jpg?resize=150%2C187" alt="Book cover: iOS 4 in Action" width="150" height="187" data-recalc-dims="1" />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 decoding="async" loading="lazy" class="alignright" title="Developing Enterprise iOS applications" src="https://i0.wp.com/akamaicovers.oreilly.com/images/0636920021759/lrg.jpg?resize=180%2C236" alt="Book cover: Developing Enterprise iOS applications" width="180" height="236" data-recalc-dims="1" />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>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2012/01/31/which-books-to-read-getting-started-with-ios-development/">Which books to read: Getting started with iOS development</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trappers.tk/site/2012/01/31/which-books-to-read-getting-started-with-ios-development/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">382</post-id>	</item>
		<item>
		<title>MainWindow.xib</title>
		<link>https://www.trappers.tk/site/2011/06/16/mainwindow-xib/</link>
					<comments>https://www.trappers.tk/site/2011/06/16/mainwindow-xib/#comments</comments>
		
		<dc:creator><![CDATA[Jeroen]]></dc:creator>
		<pubDate>Thu, 16 Jun 2011 19:17:02 +0000</pubDate>
				<category><![CDATA[apple]]></category>
		<guid isPermaLink="false">http://www.trappers.tk/site/?p=324</guid>

					<description><![CDATA[<p>[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="https://www.trappers.tk/site/2011/06/16/mainwindow-xib/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2011/06/16/mainwindow-xib/">MainWindow.xib</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></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 decoding="async" loading="lazy" class="size-full wp-image-332 alignright" title="Start with Empty Application template" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-1.png?resize=492%2C99" alt="Start with Empty Application template" width="492" height="99" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-1.png?w=492&amp;ssl=1 492w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-1.png?resize=300%2C60&amp;ssl=1 300w" sizes="(max-width: 492px) 100vw, 492px" data-recalc-dims="1" /></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 decoding="async" loading="lazy" class="alignright size-full wp-image-333" title="Add Empty Interface Builder document" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-2.png?resize=325%2C85" alt="Add Empty Interface Builder document" width="325" height="85" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-2.png?w=325&amp;ssl=1 325w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-2.png?resize=300%2C78&amp;ssl=1 300w" sizes="(max-width: 325px) 100vw, 325px" data-recalc-dims="1" />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 decoding="async" loading="lazy" class="alignright size-full wp-image-334" title="The empty design surface of MainWindow.xib" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-3.png?resize=770%2C416" alt="The empty design surface of MainWindow.xib" width="770" height="416" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-3.png?w=940&amp;ssl=1 940w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-3.png?resize=300%2C162&amp;ssl=1 300w" sizes="(max-width: 770px) 100vw, 770px" data-recalc-dims="1" /></p>
<ul>
<li>Change the class of File&#8217;s Owner to UIApplication</li>
</ul>
<p><img decoding="async" loading="lazy" class="size-full wp-image-335 alignright" title="Change class of File's Owner to UIApplication" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-4.png?resize=641%2C176" alt="Change class of File's Owner to UIApplication" width="641" height="176" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-4.png?w=641&amp;ssl=1 641w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-4.png?resize=300%2C82&amp;ssl=1 300w" sizes="(max-width: 641px) 100vw, 641px" data-recalc-dims="1" /></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 decoding="async" loading="lazy" class="alignright size-full wp-image-336" title="Add Object to the document" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-5.png?resize=638%2C300" alt="Add Object to the document" width="638" height="300" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-5.png?w=638&amp;ssl=1 638w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-5.png?resize=300%2C141&amp;ssl=1 300w" sizes="(max-width: 638px) 100vw, 638px" data-recalc-dims="1" /></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 decoding="async" loading="lazy" class="alignright size-full wp-image-337" title="Change class of the object to xAppDelegate" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-6.png?resize=635%2C298" alt="Change class of the object to xAppDelegate" width="635" height="298" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-6.png?w=635&amp;ssl=1 635w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-6.png?resize=300%2C140&amp;ssl=1 300w" sizes="(max-width: 635px) 100vw, 635px" data-recalc-dims="1" /></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 decoding="async" loading="lazy" class="size-full wp-image-338 alignnone" title="Add a window to the document" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-7.png?resize=639%2C380" alt="Add a window to the document" width="639" height="380" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-7.png?w=639&amp;ssl=1 639w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-7.png?resize=300%2C178&amp;ssl=1 300w" sizes="(max-width: 639px) 100vw, 639px" data-recalc-dims="1" /></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 decoding="async" loading="lazy" class="alignright size-full wp-image-339" title="Link the application delegate" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-8.png?resize=641%2C210" alt="Link the application delegate" width="641" height="210" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-8.png?w=641&amp;ssl=1 641w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-8.png?resize=300%2C98&amp;ssl=1 300w" sizes="(max-width: 641px) 100vw, 641px" data-recalc-dims="1" /></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 decoding="async" loading="lazy" class="alignright size-full wp-image-340" title="Link the window outlet of the app delegate" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-9.png?resize=639%2C187" alt="Link the window outlet of the app delegate" width="639" height="187" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-9.png?w=639&amp;ssl=1 639w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-9.png?resize=300%2C87&amp;ssl=1 300w" sizes="(max-width: 639px) 100vw, 639px" data-recalc-dims="1" /></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 decoding="async" loading="lazy" class="alignright size-full wp-image-341" title="Add a label for testing" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-10.png?resize=697%2C360" alt="Add a label for testing" width="697" height="360" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-10.png?w=697&amp;ssl=1 697w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-10.png?resize=300%2C154&amp;ssl=1 300w" sizes="(max-width: 697px) 100vw, 697px" data-recalc-dims="1" /></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-11.png"><img decoding="async" loading="lazy" class="size-full wp-image-342 alignnone" title="Set the Main Interface to MainWindow" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-11.png?resize=770%2C238" alt="Set the Main Interface to MainWindow" width="770" height="238" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-11.png?w=849&amp;ssl=1 849w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-11.png?resize=300%2C92&amp;ssl=1 300w" sizes="(max-width: 770px) 100vw, 770px" data-recalc-dims="1" /></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 decoding="async" loading="lazy" class="alignright size-full wp-image-360" title="we're done" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-12.png?resize=380%2C264" alt="we're done" width="380" height="264" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-12.png?w=380&amp;ssl=1 380w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Step-12.png?resize=300%2C208&amp;ssl=1 300w" sizes="(max-width: 380px) 100vw, 380px" data-recalc-dims="1" /></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>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2011/06/16/mainwindow-xib/">MainWindow.xib</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trappers.tk/site/2011/06/16/mainwindow-xib/feed/</wfw:commentRss>
			<slash:comments>67</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">324</post-id>	</item>
		<item>
		<title>Apple: iOS5</title>
		<link>https://www.trappers.tk/site/2011/06/06/apple-u2u-ios5/</link>
					<comments>https://www.trappers.tk/site/2011/06/06/apple-u2u-ios5/#respond</comments>
		
		<dc:creator><![CDATA[Jeroen]]></dc:creator>
		<pubDate>Mon, 06 Jun 2011 20:09:51 +0000</pubDate>
				<category><![CDATA[apple]]></category>
		<guid isPermaLink="false">http://www.trappers.tk/site/?p=320</guid>

					<description><![CDATA[<p>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!</p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2011/06/06/apple-u2u-ios5/">Apple: iOS5</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Screen-shot-2011-06-06-at-22.05.08.png"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-321" title="Screen shot 2011-06-06 at 22.05.08" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Screen-shot-2011-06-06-at-22.05.08.png?resize=567%2C230" alt="" width="567" height="230" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Screen-shot-2011-06-06-at-22.05.08.png?w=567&amp;ssl=1 567w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/06/Screen-shot-2011-06-06-at-22.05.08.png?resize=300%2C121&amp;ssl=1 300w" sizes="(max-width: 567px) 100vw, 567px" data-recalc-dims="1" /></a></p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2011/06/06/apple-u2u-ios5/">Apple: iOS5</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trappers.tk/site/2011/06/06/apple-u2u-ios5/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">320</post-id>	</item>
		<item>
		<title>Windows Azure SDK for iOS</title>
		<link>https://www.trappers.tk/site/2011/05/10/apple-u2u-windows-azure-sdk-for-ios/</link>
					<comments>https://www.trappers.tk/site/2011/05/10/apple-u2u-windows-azure-sdk-for-ios/#respond</comments>
		
		<dc:creator><![CDATA[Jeroen]]></dc:creator>
		<pubDate>Tue, 10 May 2011 12:45:44 +0000</pubDate>
				<category><![CDATA[apple]]></category>
		<guid isPermaLink="false">http://www.trappers.tk/site/?p=311</guid>

					<description><![CDATA[<p>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="https://www.trappers.tk/site/2011/05/10/apple-u2u-windows-azure-sdk-for-ios/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2011/05/10/apple-u2u-windows-azure-sdk-for-ios/">Windows Azure SDK for iOS</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Yesterday Microsoft announced the availability of an iOS specific SDK for Azure development.</p>
<p><a href="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/05/azureIphone.png"><img decoding="async" loading="lazy" class="alignleft size-full wp-image-312" title="azureIphone" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/05/azureIphone.png?resize=179%2C336" alt="" width="179" height="336" data-recalc-dims="1" /></a><a href="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/05/BlobStorageIPhone.png"><img decoding="async" loading="lazy" class="alignleft size-full wp-image-313" title="BlobStorageIPhone" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/05/BlobStorageIPhone.png?resize=179%2C336" alt="" width="179" height="336" data-recalc-dims="1" /></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>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2011/05/10/apple-u2u-windows-azure-sdk-for-ios/">Windows Azure SDK for iOS</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trappers.tk/site/2011/05/10/apple-u2u-windows-azure-sdk-for-ios/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">311</post-id>	</item>
		<item>
		<title>Fullscreen background plugin now in WordPress repository</title>
		<link>https://www.trappers.tk/site/2011/03/30/fullscreen-background-plugin-now-in-wordpress-repository/</link>
					<comments>https://www.trappers.tk/site/2011/03/30/fullscreen-background-plugin-now-in-wordpress-repository/#comments</comments>
		
		<dc:creator><![CDATA[Jeroen]]></dc:creator>
		<pubDate>Wed, 30 Mar 2011 21:00:29 +0000</pubDate>
				<category><![CDATA[tinternet]]></category>
		<guid isPermaLink="false">http://www.trappers.tk/site/?p=304</guid>

					<description><![CDATA[<p>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="https://www.trappers.tk/site/2011/03/30/fullscreen-background-plugin-now-in-wordpress-repository/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2011/03/30/fullscreen-background-plugin-now-in-wordpress-repository/">Fullscreen background plugin now in WordPress repository</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></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="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/03/fullbg.png"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-305" title="fullbg" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/03/fullbg.png?resize=607%2C243" alt="" width="607" height="243" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/03/fullbg.png?w=607&amp;ssl=1 607w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/03/fullbg.png?resize=300%2C120&amp;ssl=1 300w" sizes="(max-width: 607px) 100vw, 607px" data-recalc-dims="1" /></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>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2011/03/30/fullscreen-background-plugin-now-in-wordpress-repository/">Fullscreen background plugin now in WordPress repository</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trappers.tk/site/2011/03/30/fullscreen-background-plugin-now-in-wordpress-repository/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">304</post-id>	</item>
		<item>
		<title>Telenet Fibernet40 local network Topology</title>
		<link>https://www.trappers.tk/site/2011/03/16/telenet-fibernet40-local-network-topology/</link>
					<comments>https://www.trappers.tk/site/2011/03/16/telenet-fibernet40-local-network-topology/#respond</comments>
		
		<dc:creator><![CDATA[Jeroen]]></dc:creator>
		<pubDate>Wed, 16 Mar 2011 21:30:39 +0000</pubDate>
				<category><![CDATA[tinternet]]></category>
		<guid isPermaLink="false">http://www.trappers.tk/site/?p=290</guid>

					<description><![CDATA[<p>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="https://www.trappers.tk/site/2011/03/16/telenet-fibernet40-local-network-topology/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2011/03/16/telenet-fibernet40-local-network-topology/">Telenet Fibernet40 local network Topology</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></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 decoding="async" loading="lazy" class="size-full wp-image-291" title="Telenet Fibernet40 with wifi setup" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/03/telenetwifi.png?resize=483%2C464" alt="" width="483" height="464" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/03/telenetwifi.png?w=483&amp;ssl=1 483w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/03/telenetwifi.png?resize=300%2C288&amp;ssl=1 300w" sizes="(max-width: 483px) 100vw, 483px" data-recalc-dims="1" />
				<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 decoding="async" loading="lazy" class="size-full wp-image-292" title="Fibernet40" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/03/Fibernet40.png?resize=654%2C515" alt="Do the test yourself at http://speedtest.telenet.be" width="654" height="515" srcset="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/03/Fibernet40.png?w=654&amp;ssl=1 654w, https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/03/Fibernet40.png?resize=300%2C236&amp;ssl=1 300w" sizes="(max-width: 654px) 100vw, 654px" data-recalc-dims="1" /></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 decoding="async" loading="lazy" class="alignleft size-full wp-image-293" title="logo_telenet" src="https://i0.wp.com/www.trappers.tk/site/wp-content/uploads/2011/03/logo_telenet.png?resize=72%2C73" alt="" width="72" height="73" data-recalc-dims="1" /></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>
<p>The post <a rel="nofollow" href="https://www.trappers.tk/site/2011/03/16/telenet-fibernet40-local-network-topology/">Telenet Fibernet40 local network Topology</a> appeared first on <a rel="nofollow" href="https://www.trappers.tk/site">Appmire blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trappers.tk/site/2011/03/16/telenet-fibernet40-local-network-topology/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">290</post-id>	</item>
	</channel>
</rss>

<!-- Comet Cache is NOT caching this page, because `$_SERVER['REQUEST_URI']` indicates this is a `/feed`; and the configuration of this site says not to cache XML-based feeds. -->