Our DNA is written in Swift
Jump

Showing Version Info

I found that I need some place to show a version in my apps, because otherwise I and my testers never know if we are talking about the same version. A problem they might be having could have already been fixed previously. Without a version info you are at a loss.

Here’s a version info box, that I came up with. This shows how to access the version string from Info.plist as well as open a new mail to the author.

- (IBAction) showAppInfo:(id)sender
{
	// a convenient method to get to the Info.plist in the app bundle
	NSDictionary *info = [[NSBundle mainBundle] infoDictionary];
 
	// get two items from the dictionary
	NSString *version = [info objectForKey:@"CFBundleVersion"];
	NSString *title = [info objectForKey:@"CFBundleDisplayName"];
 
	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[@"About " stringByAppendingString:title]
						  message:[NSString stringWithFormat:@"Version %@\n\n© 2009 Drobnik.com", version]
						  delegate:self
						  cancelButtonTitle:@"Dismiss"
						  otherButtonTitles:@"Contact", nil];
	[alert show];
	[alert release];
}
// this function from UIAlertViewDelegate is called when a button is pushed
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
	UIApplication *myApp = [UIApplication sharedApplication];
 
	// cancel button has index 0
	switch (buttonIndex) {
		case 1:
		{
			[myApp openURL:[NSURL URLWithString:@"mailto:oliver@drobnik.com"]];
			break;
		}
		default:
			break;
	}
 
}

Two buttons are displayed side by side. Three or more are vertically stacked. This is how the result from the code about looks like:

All Purpose About Box

Call for Beta Testers – Mobile App Sales Report App

If you have a couple of apps where you get sales reports, haven’t you had the same problem as me, that daily reports are only available for 7 days and it’s a big hassle to keep downloading all of them. And even if you do, you don’t have any overview or analysis or charts…

ASiST First screenshot

Over the past two months I have been developing an App that runs on your iPhone and automatically downloads all new daily and weekly reports once you start the app. The reports are nicely shown with country flags and converted to your favorite currency. The report data is inserted into a local sqlite database which you can also transfer away from the iPhone via the built in web server. So the data is safe even long after Apple removed the report from the iTunes Connect site. There are also charts (1 so far, but more to come) to help you optically analyze sales trends and see how your apps are doing. The iTunes Connect logon is kept on the iphones secure keychain for safekeeping.

I am using it myself and every day I am anxious to see the previous day’s sales for my two apps and what the trend is.

I am looking for about a dozen people who would want to try out the app in different countries. Their benefit will be that they will get to keep the app for free and use forever.

A little more polishing and then I am going to find out wether Apple will permit such an app. Probably not, but if they do then it will be highly useful for everybody who is making the least bit of money in the store.

Future additions planned:

  • automatic downloading of customer feedback from iTunes
  • also downloading of financial reports
  • financial predictions of the current month’s approximate income
  • track when regions that are still below $250 will finally have earned enough to be cashed out
  • suggestions welcome

 To sign up for the BETA drop me an e-mail.

Remove Whitespace from NSString

In Cocoa Touch you always need to write more to achieve the same …

NSString *string = @" spaces in front and at the end ";
NSString *trimmedString = [string stringByTrimmingCharactersInSet:
                                  [NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSLog(trimmedString)

While such a standard task might look excessively much code to write, you gain many additional possibilites of what you could want to trim away. NSCharacterSet also knows these other sets. 

  • alphanumericCharacterSet
  • capitalizedLetterCharacterSet
  • controlCharacterSet
  • decimalDigitCharacterSet
  • decomposableCharacterSet
  • illegalCharacterSet
  • letterCharacterSet
  • lowercaseLetterCharacterSet
  • newlineCharacterSet
  • nonBaseCharacterSet
  • punctuationCharacterSet
  • symbolCharacterSet
  • uppercaseLetterCharacterSet
  • whitespaceAndNewlineCharacterSet
  • whitespaceCharacterSet

New Blog started

After blogging for 10 years in German I thought to myself, “Hey. This app development really starts being a serious part of my life. I’d better dedicate a dedicated blog to it!”

Every now and then I would blog programming related topics in a category on my personal blog, but those always felt somewhat misplaced. Then I am frequently discovering new ways how to manage certain tasks in Cocoa Touch, but didn’t have a place to put this new-found knowledge.

Now I do.

All the while I was blogging on my own blogging engine. But software development generally is a TEAM effort. In this case TEAM is a German acronym for  “Toll, ein anderer macht’s” which can be translated as “Great! Somebody else takes care of it!”

I want to concentrate on developing iPhone apps, not coding a blog engine. WordPress to the rescue! This blog was literally running within 5 minutes. And while I was at it, I remembered the suggestion of a BETA tester to find a place where people can submit bugs and suggestions for my apps. My future brother-in-law suggested Mantis and this was also running in only a few minutes. 

The bug reporting site for all my apps is now located at http://www.drobnik.com/bugs