If you like my tutorials, you will love my book . It is chockful of advanced programming techniques and the only comprehensive barcode reference for serious iOS developers.
Our DNA is written in Objective-C

Detect Roaming

hhyyy9 asks:

It’s possible to detect when device goes on roaming or out of home network and turn on / turn off the data connection?

Well, yes and no. Yes to the part of the question about detecting. No to changing a system setting.

You have no direct access at all to roaming or home network information. Probably via a private framework but Apple does not approve of apps using those. Though you could infer the currently used data network from the IP address range you get from the currently active cellular connection. Each provider will have certain IP ranges and if you collect these ranges then you could build up a database to detect such network switching.

Also wheres the point? There already IS a setting that allows you to disable data roaming.

general network

The fact remains that you still cannot mess with the data system setting, but only work within your app.

But this would not be an worthy Dr. Touch post if I didn’t share some cool knowledge, this time how you can get all the current IP addresses of your device. Something like “IPCONFIG /ALL” on Windows or “IFCONFIG” on Unix.

Read more

Magic Mouse has landed

After waiting 10 days – the Apple Store website claimed “ready in 4 days” – my order has arrived. Yesterday I got slightly nervous when I tried tracking the package and found the number was shipped to Manila one month ago. But there was another shipment with a different reference number below it, showing that the package has left Prague and was on it’s way to Vienna.

This morning I found two packages on my desk and so I recorded a quick unboxing ceremony in my lunch break. Thankfully I had a colleague hold my iPhone 3GS, he’s done a good job capturing my emotions. ;-)

After you free the Magic Mouse from it’s Snow White glass coffin you might also feel tempted to kiss it to life. But instead it comes to life if you turn it on and seek with the bluetooth assistant. It gets recodnized as a regular mouse, no gestures yet. Then you need to look for software updates and download the mouse-related update. After a reboot the mouse settings panel changes to something similar to what we are used to from the glass trackpad of the Unibody MacBooks.

Read more

State of the Art in Cracking Apps

With the number of apps on the app store soon reaching the big 100.000 it is only logical that piracy continues to flourish. At the beginning of this year a tool named Crackulous promised to make it easy for everyone to become a pirate, claiming to be the solution to a flawed app store. At the time of this writing Crackulous version 0.9 is public and the next version 1.0 is being “in development” for more than half a year.

Piracy is a thorn in the side of all small time iPhone developers who can hope to make around $10 per app per day. Those hard working coders now face the likelyhood of  loosing half of their revenue to pirates making it continuously easier to get the apps for free. According to latest numbers of Pinch app to 60% of apps in use are in fact cracked copies.

There are several things that you can do being such a developer who sees a at least a portion of his potential income being stolen.

  • cease to protect and consider pirated apps as additional advertisements
  • pay hundreds of dollars to a professional protection service
  • do some research and collect together methods to detect cracks and modify your app’s behavior if you find it is cracked
  • join the AntiCrack community to gain access to our repository and put this into your apps, mix and match, use what you like
  • or the fatalistic option is too cease making iPhone apps alltogether

I encourage everyone to do a bit of his own research to understand the techniques that are out there and maybe develop a couple of your own. But for everybody who still wants to try to do at least something we made AntiCrack.

Read more

Alternating Tableview Cell Backgrounds

Wanner asks:

“How can I make my cells alternate colors across multiple sections if the sections don’t always have the same number of rows?”

A nice effect that you sometimes see in table views like the app store app is when you alternate the tableview cell backgrounds between light and dark shades of a color.

Read more

I predict: No Mac Tablet before Summer 2010

In his recent article The Apple Tablet OS & User Experience Mike Rundle speculated on several scenarios regarding which OS and UI to expect from any coming Mac Tablet. It’s an interesting read. Now there are a couple of things that are absent from public discussion which I am trying to shed some light on.

iPhoneOS is actually a branch of MacOS which is basically an open source OS based on BSD plus many Apple-specific additions like the proprietary Window manager. This was said multiple times by Apple employees in passing. Apple is working very actively to reintegrate “learnings” and also iphone custom code they needed to specially create for handling multi-touch back into the MacOS version that’s to come after Snow Leopard. Touch is only one thing, another thing thats still missing from CoreOS is the advanced power saving techniques that make the iPhone work a whole day. An absolutely essential thing if you don’t wont to recharge your tablet every 3 hours.

Then there is the matter of chips. The mobile parts all rely on ARM and even the chip company that was acquired by Apple probably will license ARM cpu designs and build them. Intel seems to just not cut it in terms of battery endurance versus processing power. Intel begs to differ, but Apple seems to have set it’s sights on using ARM as the main platform for all their mobile devices. The current MacOS can only be built for Intel, support for PowerPC has been discontinued for 10.6.

I think what’s happening right now inside Apple is this: They are trying to achieve what Microsoft has abandoned eons ago: a unified CoreOS which can be built for a variety of cpus. One possible reason besides the platform’s age might be to free up manpower to work on ARM being the second possible build platform for CoreOS. Apple might also drive a dual strategy and choose whatever chip platform has the most endurance for the needed performance at the time of manufacture. With a unified OS they could switch CPUs at a whim and thus can get better prices for their CPUs.

This will be also the platform to power the iPad. Apple will not compromise on the technology just to make it compatible with current generation binaries. Though most likely in a future version of XCode you will just have to change the build platform so that you can rebuild your iphone app for the ipad. And in some circumstances you’ll have to rearrange the UI elements and resize static images where used. So I guess a month in lead time should be sufficient for most app developers to get a couple of their apps rebuilt.

It will still be Objective-C though…

The most important question is which strategy would make Apple more money: an open OS for which anyone can write and sell apps. Or the iphone strategy where they make 30% on each sale. Clearly the latter has proven to be an enormous boon for Apple. So why should they change it? It is very likely that iTunes for Macs will get a Mac app store at the same time that a iPad section opens on it because both will you will be able to purchase CoreOS apps (Apple hopes also to sell much more games this way) via iTunes.

Actually I don’t think we will see the iPad shipping at the beginning of 2010 as some sites predict. It might be technically “done” already, but the OS is still missing. If Apple continues their recent pattern then we can expect Mac OS X v10.7 “COREpard” in Summer 2010. That will be the time when we will see the iPhone 4G being released as well as the iPad.

In any case we developers can look forward with anticipation of added profits from additional platforms and being able to sell almost identical content several times: for iPhone, iPod, iPad and Mac.

MyAppSales 1.0.10 – Multi-Account & Push Notifications

Exactly a month and 2 days have passed since the latest update and you guessed correctly: this is a major one. It brings two technologies into MyAppSales that I was kind of afraid to try because I was fearing the technical difficulties and the work that was necessary to make them work. But now that they are in, I’m glad I did.


  • ADDED: Smart Multi-Account capability. You can now add multiple ITC accounts and the reports will be downloaded. Note that the UI is still the same, so reports will appear individually, always showing all apps. This will be addressed in a future version.
  • FIXED: The Passcode Lock also appears if the app resigns active status.
  • FIXED: Some financial reports from January 2009 or before would cause a crash because Apple was using full country names previously, some with strange abbreviations.
  • ADDED: When a new report is downloaded my server is anonymously pinged and saves the availability time. The first time a new report is encountered a push notification is sent out.
  • ADDED: Different types of accounts are now supported. To begin with you can setup multiple ITC accounts and one Notifications account.
  • ADDED: Notifications via the 3rd party app Notifications can now be subscribed or deleted via adding and removing of the account in settings.
  • ADDED: The myappsales:// URL scheme is now supported to open MyAppSales to a specific report screen. This is used by the push notifications to open up the daily reports page where you can see the new report appear.

If you are upgrading from a previous version then it will appear as if MyAppSales is downloading all reports again. It does not really duplicate the reports and you can just let it run. But you may also quit the app via the home button after the first such download. This is necessary to establish the smart app groupings. MyAppSales figures out which apps belong to which group (aka account) and will use this fingerprint in the future to intelligently establish which account a report belongs to and if it is a duplicate. This approach also allows to detect from which account manually imported reports are coming and sets up the app to get reports from totally different sources in the future. One such service will be allowing you to share sales data on specific apps with selected users.

Multi-Account Type SelectionI have to use a 3rd party app to do the push because only Apple approved apps can do push notifications. But I can piggyback on their service to make the experience identical as if MyAppSales had notifications itself. The only differences are that you have to set up a Notifications account and that MyAppSales cannot directly deal with notifications while its open. So if you are the first to see a report and you get the notification just click “Cancel”.

It is recommended that you make a local copy of the database via the built-in webserver. There should be no problems in updating, but in some rare cases manual changes might be necessary. And it never hurts to have a backup.

Version 1.0.10 is tagged in the Subversion Repository. You can either updated your source from there or opt to update from trunk where development is continuing. Tagged versions are always a stable milestone while in the trunk I make no such warranty.

Daylight Savings Time … there's an app for that (NOW)!

When I researched locales for LuckyWheel and time zones for MyAppSales I discovered that Apple had outfitted my iPhone with a complete database of all timezones worldwide as well as methods that would return the next DST switching time. Back then I thought “that would be a cool feature” and found it strange that there is nothing like this in the regular iPhone UI to actually access this data.

Do you know the feeling that you have an app stuck in your head that wants to get out? You’ll know what I am talking about if you have an idea that frequently comes into your mind because you have not acted on it. There are three ways to deal with such ideas:

  • look up your local locale and down enough alcoholic beverages to destroy those few synapses that kept bothering you.
  • use a notepad (or notepod) to jot down the idea and draw some sketches off the pictures that float around in your head. To the idea this will feel like validation and it will stop vying for your attention.
  • or if it can be done in a day, build the app!

I just had finished my work on the H1N1 Swineflu Defender app contract, so I had a couple of days of my spare time to spare for a quick app like that. And strangely enough this way just the perfect time right before the next DST switches for Europe and the USA to also capitalize on DST being a hot topic this time of year as everybody is searching on Wikipedia or Google for when the switch will actually occur.

Read more

Useful Push Notification for Developers

A couple of days ago I put in a feature into MyAppSales so that my server gets pinged anonymously if a user sees a new report. Actually all downloaded reports are reported by date, type and region, but I am keeping track of the first report for a specific key. Turns out the reports really DO get available simultaneously around the globe. That’s fair.

Now what good is this information? Well, if you are like me you are still excited to see the previous day’s sales figures as soon as they become available. But with Apple sometimes being very slow in processing it could mean that you have to try the download serveral times until finally it is there.

Notifications AppEnter Push! You can get the new report availability notification in three ways:

  • Tell me an e-mail to send it to
  • Via the iPhone app Notifications. Tell me your token.
  • By following @myappsales on Twitter.

What else could be pushed to be useful to you? Anything relevant to iTunes Connect?

Even though MyAppSales was banned forever from the app store with the help of Notifications it still get’s push. And it works fabulously well for three days straight.

Even if you don’t use MyAppSales you could still benefit from knowing when your new daily report is available and download it via AppViz or any other downloader of your choice.

One idea are availability notifications. You would notify a server when you submit an app to apple. Then you would get a notification when Apple tests the app online. Finally you get a notification as soon as the app appears on the app store.

I want to hear your needs. Maybe there can be an app for that … or a service … or a notification.

Making (Google) Waves

Being a geek at heart I instantly got excited when Google presented Wave to developers attending the I/O Conference. They call Wave a “personal communication and collaboration tool” when they unveiled it to the public for the first time. Since then a digital divide has opened up: those who have Google Wave accounts and those who want one.

For some reason that has many heads shaking in disgust they opted to not immediately release it to the general public like they would do with BETA versions but instead do it in waves of a couple hundred-thousand each. So besides from working for Google or being close to them in any other way, the only way to get a coveted Google Wave account was to wait to be nominated by one of the few members who have nomination rights. The first bunch of accounts went to people who are looking to write plugins aka “bots” to add more functionalities.

After a few minutes of experimenting you start to understand how to edit Waves. You can double-click into a body of text to get an option to edit. Once you do, all other people watching the wave will see your named cursor making the modifications almost live. You can also respond to specific blocks by clicking on their lower border. At the end of a thread you get “Continue this thread”, on a post in between you see “Insert Reply here”.

Due to my interaction with the iPhone developer community and me making no secret out of my wish to get on Wave, some friendly colleague blessed me with an invitation and two days later I was on. If you want to use Wave for something more than just a glorified rich text editor, you need to have contacts to “wave” at. So I started a wave where I am adding every iPhone developer who also happens to have a Wave account.


If you happen to have a Google Wave account yourself then please wave me at I am still “collecting” developers. As of this writing there are 16 developers on it. If you open the wave you see the other participants at the top and by clicking on their icons you can add them to your own contacts. The experiment is to see if some creativity could could be sparked if you just get enough like-minded people in the same place.

I am excited about Wave because in daily life I find myself in many situations where I get e-mails with just one line of text that would have been better put in a tweet or instant message. And if you respond to specific parts of the message all the original text is quoted and mangled differently between different e-mail clients. Wave could solve this problem by having one Wave being one topic that is being structured by all its participants. The original bits stay intact. Also you can play back a wave to step through all the changes that where made over time to find out who is responsible for a specific edit.

Wave in mobile Safari

Google Wave can be seen as a the bold attempt to make e-mail and instant messaging obsolete, but it can only achieve this if it reaches critical mass sooner rather than later. It was only 2 years ago, with the purchase of my first iPhone, that I got e-mails working and in sync between my mobile device, my Exchange mail server and my Mac. To make Wave a success over just being a glorified geekery about how cool it is to have multiple cursors editing the same document, there needs to be total integration into the platforms we already use. And I mean BINARY integration. Not just a browser window into a cloud but also offline capability and a mobile UI that will convince people to make Wave their primary means of communication.

Yesterday I also experimented around with the mobile version of Wave. If you access it with your iPhone’s safari you get a warning about it not being supported, but you can proceed at your own risk. Basic reading and responding to threads works well, though after a while you see why its not yet “officially supported”. Well, because of the ALPHA status its not even inofficially supported, but you find that some of the functions just don’t work. For example I found no way how I could enter editing mode for an existing Wave, some miniature buttons don’t do anything when tapped. But it is clear that Google is making an effort, because at first glance it looks quite usable even over 3G.

People, or the current lack thereof, are just one of several factors that need to be addressed to make Wave a success. The other main reason for people writing a blog and trying to interact with readers and friends alike is that you will be able to embed waves into blogs retaining the possibility of commenting and collaborative editing. Somebody could ask me a question and I could elaborate on the answer in a Wave. Once everything has been ironed out I can publish the wave to an article.

One question that’s been on my mind is if Google Wave will also be capable of replacing Wikis. There are many people who either keep all their “documentation” in their mail client or meticulously sort them into their personal Wikis. Or somewhere in between, say text files on harddisks. Wave offers folders and custom searches, but I don’t see yet how you can organize knowledge on a larger scale with it. But maybe down the road we will also edit Wikis from within Google Wave.

Finally the promise is also to be an open standard based on open source. Companies will be able to set up their own Wave servers and provide identity to users. Still, through a process called federation, the promise is to still be able to interact with Waves hosted on Google or other Wave servers. That is clearly the way ahead because even though Google claims to “not be evil” it is simply prudent to keep your confidential data on your own servers.

PS: One video on YouTube was also making waves. Some creative guy used quotes from Pulp Fiction to demonstrate a few of the things you can do in a wave.

Kernseife (SOAP for iPhone) has a SOAP-based API, which is also how AppViz is getting the ranking data. I’ve been putting it off for a while, but finally I tried to find a painless way to generate proxy classes for the webservice. I failed.

Well, not entirely, there IS a plethora of frameworks and toolkits that promise to automatically generate proxy classes for you. Only problem, these are either C++ based, or use libxml or use other xml parsers like are present in CoreFoundation on the Mac, but not on the iPhone. Also the code that gets generated by tools like wsdl2objc gives me the creeps.

A proxy class is a class that looks like a normal class that you can instantiate and use it’s methods. But behind the scenes it packages all calls in SOAP or HTTP GET/POST, calls the server, retrieves the answer and unpackages the returning SOAP envelope. Basically you program against the web service as if the functionality offered is part of your local code.

Read more