Our DNA is written in Swift

OpenStreetMap in a UIWebView

Nicholas asks:

I’ve made an attempt recently to incorporate OpenStreetMap into my app. I’ve failed miserably. The result is a blank webpage. Any help/hints would be appreciated.

I immediately suspected that there was wrong with how he constructed the URL for the UIWebView, because I did run into a similar problem before.

Read more

Transfer App Data Back to Your Mac

If you are saving data in your apps then you are saving them to your app’s sandboxed documents directory. In simulator files you can easily inspect the contents of the directory if you just browse there with finder or cd there in terminal. Note that there is a space in the path, so you need to put exclamation marks around it if you use it with cd in terminal.

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSLog(documentsDirectory);  // output documents directory to debug console

Copy this path, open terminal and go:

MacDrops:~ Oliver$ cd "/Users/Oliver/Library/Application Support/iPhone Simulator/User/Applications/AAC8D0E8-C134-4A94-ACA9-88C7A58DCE1C/Documents"

Or if you prefer Finder then use the handy option “Go To Folder …” and paste the path there. Bear in mind that with every new build the documents directory gets moved to a new application ID. The contents will persist, but the path changes. If you navigate to the ../User/Applications folder you will find that the newest directory is the one that belongs to your just-built app.

There are some rare cases though when you find that Simulator behaves differently than a device. How can you inspect the files there?

Read more

Excursion: Follow 900 Twittering iPhone Developers

After having started this blog a trainee of mine recommended I get started with twitter because I was trying to get connected to other iphone developers. I figured it would probably be useful if you had a network of, say, a thousand guys who are also interested in coding iPhone apps.

Read more

AppRanking 1.1.2

AppRanking IconNOTE: AppRanking has been deprecated in favor of Applyzer.

While other people where looking for easter eggs Michael Dorn searched for and eliminated some bugs unintential easter eggs in AppRanking.  What’s new?

  • An icon
  • No more crashes when unchecking and reloading ranks
  • Adding of your apps is now more intuitive, following the plus and minus paradigm.

Known issues

  • Minor: In the ranking history you need to click the category header twice to make the sort order change
  • Minor: Some English spelling mistakes 

AppRanking 1.1.2

AppRanking (No longer available, see above note)

It’s free, but please donate any amount that pleases you if you like AppRanking and want for Michael to keep improving it.

AppRanking 1.1.1

NOTE: AppRanking has been deprecated in favor of Applyzer.

Michael Dorn has updated AppRanking to version 1.1.1 and made it even more WOW. I tried it out with the app ID for iWoman and was rather astonished to see that my app has made it into the top 10 apps of category Health&Fitness in 8 countries. This could happen to you to if you start checking out changes of your app’s ranks with with useful tool.

What’s new?

  • Rankings are now saved (optional)
  • Export to CSV of ranking history
  • AppIDs are now saved
  • Expanded instructions
  • Lots of bug fixes

Known issues

  • No pretty icon, yet
  • Don’t click on the header to sort the results while update is in progress. You might mix up countries and ranks. But that’s only a display issue, ranks seem to be saved correctly in the history.

AppRanking 1.1.1

Note that you can easily select all countries by clicking on the header above the country checkboxes.

AppRanking for FREE (No longer available, see above note)

It’s a ZIP file with an Mac APP inside. Again, like all free software this comes without any warranty. Use at your own risk.

Peer Reviews

For a long time I was unable to review other people’s apps because those 50 promo codes you get per version only work in the US store. But then somebody showed my a secret maneuver that allows anybody to get an iTunes account with access to the US store. (Mail me if you must know).

Now don’t get me wrong, I don’t want to get into the app reviewing business. I rather leave this to my friends, like Crazy Mike. But I see that there is a niche somewhere between the consumer-oriented review sites, the in-store iTunes reviews and the internal secrect review process inside of Apple. This niche is providing unbiased opinions of a fellow developer.

That’s something only somebody can provide who themselves keeps going through the long and painful development process. Those who not just develop apps, but also develop themselves. Read more

Unicode, Schmunicode!

You are listening to user feedback, especially those in Italy. You solve all their problems with a new version, in my case LuckyWheel 1.0.3. You polish it, test it (you think) and submit it to Apple for review. After a week you get this message back:

Your applications, LuckyWheel and LuckWheel Lite, cannot be posted to the App Store at this time because they do not achieve the core functionality described in your marketing materials, or release notes.  Applications must adhere to the iPhone Human Interface Guidelines as outlined in iPhone SDK Agreement section 3.3.5.

The release notes for both applications state, “Italian UI and Instructions added”.  However, in our review, when we put the device into Italian language mode and launched the applications, the application UI was still in English.  Only the instructions were changed to Italian.  See attached screenshots.

In order for your applications to be reconsidered for the App Store, please resolve this issue and upload your new binaries to iTunes Connect.

That’s a very long way to say: “Hey buddy, your Italian is English!”

When I got this message I was stumped. I though I had tested it. Thieves! Who has stolen my Italian UI?! But then I remembered something I had found out some months ago.

Read more

Stanford University iPhone Programming Course

Stanford UniversityFamous Standford University goes the way of the modern educational institution and beginning today makes it’s iPhone Programming Course available in parallel on iTunes U for free while it is being taught live in class by original Apple framework guru Evan Doll. So you don’t get a dusty teacher figure, but the real thing!

I encourage all students of Cocoa Touch to participate in the sessions. Simply subscribe to the video podcast on  iTunes U and watch it comfortably at home or on your iPhone. The course material including downloads and assignments can be found on an accompanying web site. Don’t be fooled by the low price tag: FREE. People usually don’t appreciate what can be had for nothing, but in this case you probably cannot find anything better.

Read more

"AppRanking for FREE" by Michael Dorn

NOTE: AppRanking has been deprecated in favor of Applyzer.

Michael Dorn (my collaborator on LuckyWheel) just couldn’t stand having to dig through iTunes to find how our game is doing in 62 iTunes countries. So he took it upon himself to create a nifty tool that allows you to conveniently look up rankings of any app. He wrote it in RealBASIC as an OSX desktop app in less than one day.

AppRanking Screenshot

Michael makes it available to all readers of Dr. Touch because it’s just soooo useful. And for free, that’s how nice he is!

AppRanking for FREE (No longer available, see above note)

It’s a ZIP file with an Mac APP inside. Again, like all free software this comes without any warranty. Use at your own risk.

Minimum/Maximum of Multiple Values

MadIvad asks:

Is there some sort of math function for the minimum of a set of values? I have searched the docs and not found one reference to math in iPhone OS2.2, and min only returns the like of ‘minimum’ for different control values. or for stating what the minimum of the integer or NSUInt class etc…

Does a function/class/anything exist that would simply return the lowest value of 2 or more values?

Boy, that was easy. There are compiler macros defined that work on any scalar datatype. MIN(a,b) and MAX(a,b). Note the case.

Read more