Our DNA is written in Objective-C

The World on an NSString

When you are are newbie in programming objective-C then you might find somethings confusing when you start using strings. Coming from C you where used to using zero terminated C-Strings. Coming from other languages you might be challenged by the fact that there is no implicit type conversion like, for example, in BASIC.

In regular C strings are pointers of type “char *”, meaning that it’s the memory address of a one byte character. The length of a C-String is determined by a binary zero ” at the end of it. Objective-C rarely uses those, instead NSString means the world to us.

The core fundamental to realize first is that you are always dealing with pointers – that is addresses in memory – when using objects (instances of classes). So it simply does not make sense to compare strings with the == operator. Two variables pointing to NSString might or might not actually point to the same instance. (Actually the same was true for C-Strings, because the same text might or might not be contained in different memory regions referenced by char * pointers)

Read more

BSA Banner

Dr. Touch #002 – "Catch Up"

So much is happening currently that I could not wait for the second episode if I wanted to be able to do it in under 15 minutes.


Subscribe to the Podcast in iTunes

My script (aka “Show Notes”) after the fold below.

Read more

Asking Users for a Review


Yves Gonzales asked:

“Would you know what the URL scheme is for writing a review in the AppStore, launched from within an app in iPhone, which opens AppStore? (I want to ask users to leave a review.)”

At first I answered that I did not think this was possible. But Yves, with the help of trusty Mr. Google discovered a better answer than mine. There is in fact a possibility to get the mobile App Store app to open on the review page for a specific app.

Read more

Dr. Touch #001 – "Prototype"

This is a prototype of a podcast episode. Please let me know in the comments or on twitter what you think about it.


Subscribe to the Podcast in iTunes

Below the fold I posted my script which doubles as Show Notes with hyperlinks.

Read more

MyAppSales 1.0.12 – Fixes

This new release fixes two urgent issues that became pressing today: Downloading and Notifications.


  • FIXED: Apple modified form field names in iTunes Connect yesterday which would cause permanent “no day options found” error message
  • CHANGED: Added code to get the field names from the HTML so that similar changes would not cause this problem any more.
  • FIXED: Push Notifications via the Notifications would cease to function. This was a bug on the server-side. Any new subscriber would overwrite the previous subscriber.
  • ADDED: If there is a Notifications account set up then the app will now check if it is subscribed at every launch. It will then subscribe if it is not – for some strange reason.

Any version prior to 1.0.12 is no longer able to download reports as of today. So if you put off updating until now then you have no choice any more.

To update either do a fresh checkout or update your existing working copy. If you have not linked your checkout back to the repository please do so and then “SCM – Update Entire Project”.

I’m also announcing the MyAppSales VIP List. If you are a CEO or otherwise important person and cannot be bothered to update your working copy of MyAppSales via XCode then this is for you. I have very limited space available on my device list but for VIPs on this list I will be making AdHoc builds for each future version. You may apply for inclusion via e-mail.

Forbidden Fruit in Apple's APIs

Apple appears to be cracking down on apps these days which are not sticking to the SDK agreement when it comes to using undocumented (read “private”) APIs. I’m attempting to make a list here, so if you have received the usual slap on the wrist for actually using one of the undocumented “features” to make it easier on yourself then please let me know so that I can add it here.

The problem with these undocumented API calls is that up until now Apple did not seem to uniformly care if they where to be found in submitted apps. But lately the reviewers seem to have gotten a static analyzer into their hands. With the help of which they can dump all the method names in your app so they will see if you are naughty or nice.

The official statement is that Apple is working on making more and more undocumented API public. They claim that those APIs are not properly tested and will probably change between OS versions thus breaking apps that rely on them. We’ll see if some of these following methods will eventually really become public.

Read more

Add one Week and Skip Weekend

dbarret asks:

“I need some help with this issue and I’m hoping you have the time to point me in the right direction, here goes:

  1. I want to display today’s date in a UILabel, then with a button event, the tricky part…
  2. display a date 7 days in the future UNLESS it’s the weekend, then it will display the following Monday.

So basically I want to display ONLY weekdays, no weekends… it that even possible?”

Of course it is possible. In this case it’s not even very difficult.

I assume that you know how to display a UILabel and set its text. So in this article I’ll show how to enhance what we previously learned about adding days to NSDates and add extra code to also skip weekend days.

Read more

Smart Developers track their Best Apps with MyAppSales

Sure, you should be doing your coding mostly because you enjoy it and only secondarily for the money. But it’s no sin to get a kick out of checking yesterday’s sales report and seeing how well your babies are performing. My aim for MyAppSales is to be the preferred mobile tool for this purpose.

I lost track some months ago, but I estimate my user base to be around 250 people worldwide. Because I am distributing MyAppSales as source code only this automatically requires users to have at least some fleeting knowledge of how to download source code from a Subversion repository. This is called “positive preselection”. That’s one of the reasons why I can hypothesize that MyAppSales users are smarter than the average Cocoa Touch developer.

I am proud of my baby and I was interested to learn which of the multitude of apps which are being tracked with MyAppSales are considered by their makers to be their crowning achievement . So I’ve asked my customers via Twitter which of their apps they deem to be their masterpiece (so far) and today I’m proudly presenting the best apps of the smartest developers to prove the hypothesis from this article’s title. I call this …

MyAppSalesMyAppSales Users’ App Showcase

Entires are sorted in order of submission. All wordings and descriptions are verbatim. The statements are not meant to be reviews but to illustrate which skills, talent and knowledge need to come together to make what a developer has the right to call “his best app”.

So what are those super powers? You’re about to find out …

Read more

Ignoring Certificate Errors on NSUrlRequest

Fabian asks:

I’m trying to request data from a website via HTTPS that does not have valid certificate. How can I ignore the certificate error?

When the iPhone makes a HTTPS request it verifies that the certificate used to encrypt the data has a valid root certificate authority. Usually – for big sites – this is provided by Thawte or Verisign or any other recognized Root Certification Authority (CA). A bundle of the public certificates of such CAs is installed in the OS and enables the client to know which CAs are valid.

The problem arises however if you don’t have the funds to purchase such a certificate from a CA, those are expensive. Or sometimes you want to create a certificate for your own use or testing. This is called self-signed certificates. Those are also deemed invalid at first glance, unless you tell your browser to accept these certificates. Or it may be the case of Twitter who seem to have an expired certificate on one of their API servers.

Read more

The new Whites – Worthy Polycarbonate Successor

A couple of days ago I got a chance to take a first feel of the new “low-end” MacBook. Well, it’s not so low after all.

For a while it looked like Apple would totally abandon the plasticBook line in favor of making everything out of Aluminium Unibodies. Though there still seems to be a magic line for quite a few Mac buyers at $1000. The cheapest Pro starts at $1199 and personally I would prefer if this would be the Thousand-Dollar-Laptop, but there’s also something psychological or maybe historical that entices Apple to continue the white line.

Maybe it’s because you can more easily affix stickers on a shell that’s made out of Polycarbonate? Hey it’s just a fancy pancy word for Plastic, so it would not mind if your kids stick some cartoon characters on it, next to the glowing Apple logo. Reimagining the fruit as just having been handed by the evil queen to Snow White?

These days when I get asked, “Oliver can you recommend a Laptop?” you can guess my answer: Mac and if you absolutely need Windows, run it in Bootcamp or virtually. Turns out the school director already had been Mac-infected for at home, so my suggestion to also get a Mac for use at school fell on fertile ground.

Being the resident Mac-Maniac I was asked to set up E-Mail, printing and install Office. In turn I asked to be recorded while unboxing the beast.

I had almost forgotten to mention this video on my blog. But then I saw on YouTube that the views already had surpassed my previous video of Unboxing a Magic Mouse. So I felt compelled to also provide an honorable spot on my blog for it.

It appears that while the Magic Mouse is way more hyped as being revolutionary and many people openly discuss if it’s worth it, the audience for white MacBooks is an order of magnitude larger. Or put differently, way more people are looking for the cheapest method to enter the Apple ecosystem, than are in the market for a fancy new mouse.

The White MacBook again pushes the envelope. Now the shell is made of 2 big parts and the top feels like plastic, the bottom like a powdery rubber. No firewire, No more seperate line-in. That’s now combined into the headphone jack. I supposed to be able to use an iPhone headset for remote-control and external Mic.

You now get up to 7 hours worth of battery life with the enclosed big battery. Now all mobile Macs have no user-servicable battery any more. So you will have to bring your favorite toy to the store and get it replaced there in 2-3 years when the retainable charge drops below a useful mobile working endurance. There’s been much discussion about the user-friendlyness of such an approach, but having now doors or stickers on the bottom of a laptop goes a long way to give you even more the feeling that “Mac just works”. Being a Windows administrator by day and seeing lots of notebooks, I honestly believe that even the simplest mobile MacBook blows any other Laptop out of the water in terms of ease-of-use and industrial design.

While we are still waiting for Apple’s answer to the netbook craze – which will not come this holiday season – the new white one is the perfect choice to give as a first Mac to your kids or wife. Daddy can still have a shiny aluminum Pro on his lap and thus be the king of the castle. All coming together in perfect Apple-Harmony for Christmas.