digital wave / Reiner Pittinger: iOS, Web Technologies, Interaction DesignSoftware Development in Berlin: iOS, Web Technologies, Interaction Design

KISS Time Profiling

In the final stage of development for my current project, I wanted to track down some performance issues in the app.

The Macro Way

First I have been looking for a really simple solution, something like my former colleague Markus once implemented, and which worked like this:

1
2
3
4
5
6
    - (void)myMethod
  {
      PROFILING_START(@"myMethod");
      // do stuff…
      PROFILING_END(@"myMethod"); // Output: "myMethod took 1.2345s"
  }

Unfortunately I could not find anything similar, just a “Quick-And-Dirty”-Profiler using Objective-C++ (hey, I took that adjective from the header-file!) and a macro that required you to wrap the code you want to profile into a block.

I did not want to use the latter one because by wrapping your code into a profiling block, you cannot simply strip out the profiling code for production.

So I came up with a really simple solution that fits into a few lines of code:

The Windows Install Rant, Part 2

My recent Windows experience was dominated by suffering.

But it seems I did not suffer enough yet…

Installing Windows 8 (at last)

The last part of my Windows-8-Installation hassle ended because I could not free up enough disk space on my Windows 7 installation.

I solved the problem with the usual approach for that platform: format c:.

I wiped everything as there was nothing important installed in Windows 7 (all the good stuff is on OS X), and installed Windows 8 on a clean bootcamp partition.

The Windows 8 Install Rant

Windows already sucks before you install it.

Although having done only iOS development in the last three years I have been insterested since the release of Windows Phone 7.5, and sometimes even enthousiastic about the development of the Microsoft platform. (I admit that the free phone I got on a Nokia developer day here in Berlin helped on my openness.)

So after Microsoft rented Times Square in New York for the Windows-8-Launch-WOOHOOOO-Event, I wanted to WOHOO-too and decided to get Windows 8.

Seems like my first mistake.

Xcode Snippet: View Debug Borders

Xcode 4 has the very neat feature of code snippets which you can extend with your own.

One thing I do regularly is to add a colored border around views to debug frames or autoresizing masks.

The snippet is just two lines of code:

<#view#>.layer.borderWidth = 1.0;
<#view#>.layer.borderColor = [[UIColor redColor] CGColor];

Just select the text above and drag it to the “User Scripts” section of the code snippets view.

  • <#view#> is you can guess a placeholder for your view, e.g. self.view
  • Do not forget to #import <QuartzCore/QuartzCore.h>and link against the QuartzCore.framework.
  • Unfortunately there is a bug that Xcode does not sync placeholders with the same id (see Stackoverflow and rdar://10071607 to file a bug at Apple)

Google Dart Event

Dart Logo

Last week I attended an event focused Dart, Googles new programming language which raised rumors to replace JavaScript.

Organized by the Google Technology User Group Berlin, the event was split in two parts:

  1. Get a feel of Dart: syntax and sugar for it, trying out the language, samples and the editor
  2. A rather lengthy presentation by Florian Loitsch (engineer in the core Dart team) with an overview of the language and its features to convince us of the greatness of Dart.

Why did Google invent Dart? Because they were not satisfied with developing really big applications in JavaScript. Side effects, slow tests and lack of tool support were the main reasons why Dart was created.

WebKit Remote Debugging Presentation

Here are the slides from talk I gave today at CocoaHeads Berlin:

CocoaHeads Berlin: WebKit Remote Debugging Slides

Abstract

Debugging UIWebView can be quite hard and cumberstone. Weinre has served the community well for over a year by supplying a WebKit-Inspector-Like interface. But recently, it seems to have stopped working.

With a one-line “magic” call, you can get your beloved WebKit Inspector in your UIWebView, too.

Additional links

My First Octo-Post

This is my first post with octopress after setting up Octopress.

BLAME myself that rsync deleted the entire old content of my homepage…