June 23rd, 2010
Yesterday Apple reviewed and approved the My Viking 1.0.2 update. It has been in the App Store for a day and I thought I’d post the change log, as most people are swamped with iOS4 support updates & don’t read the update descriptions.
Call history
- Call history displays hours when the duration of a call or data session is longer than 1 hour. Example: 67:01 becomes 1:07:01
- Fixed issue where the duration of calls was equal to the sum of the call and the time the phone rang instead of only the call duration.
- Fixed issue where scrolling through the list caused free texts/data sessions to show a cost.
Analysis
- When more than 1000 text messages are left in the bundle, because the bundle was topped up before the previous bundle expired. The text messages prediction is hidden because we can not make a reasonable prediction in this specific case.
- Improved display of data sizes smaller than 1MB. Example: 0,6MB is shown instead of ,6MB
With this “bugfix” update available I can start working on some real improvements & new features. I still haven’t decided yet, but the next version could be a iOS4 only update.
As always progress & related news can be followed on Twitter.
Posted in Emmer Inc | No Comments »
June 23rd, 2010
Since I always forget how to convert a NSData object to NSString and vice versa, I thought I’d write it down as a reference. Every time I work with a REST service and need to know what response I’m receiving, before handing the NSData object to a NSXMLParser, I’m always dumbfounded that I’ve forgotten how to do the conversion.
// From NSString to NSData
NSString *text = @"Some string";
NSData *data = [text dataUsingEncoding:NSUTF8StringEncoding];
// From NSData to NSString
NSString *text = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
Who knows if it helps some one else.
Tags: NSData, NSString
Posted in Cocoa Touch | No Comments »
June 6th, 2010
As some of you have read on Twitter, an update of My Viking has been sent to Apple yesterday evening. Well actually today early in the morning, to be more precise. This update mainly contains bug fixes & several small improvements. I chose not to introduce any big features in this version, so I could get it off to Apple as soon as possible, less than a week after the initial release of the first version.
Here’s the change log:
General
- Added support for older firmwares, iPhone OS 3.0 and onwards.
- Improved French translations.
- When wrong credentials are filled in, an error message is shown saying the username and/or password is wrong.
Main screen
- Improved display of remaining time in main screen, now shows remaining hours when less than 1 day is left.
Analysis
- Solved issue related to having more than 1000 text messages in the bundle.
- Solved rounding issue related to calculating how many minutes and/or text messages can be called/sent.
Call history
- Call history now displays how many KB’s/MB’s where used for data connections as well as a duration.
- Minor improvement related to display of names.
- Solved issue causing dates to be displayed as (null) when AM/PM mode was chosen.
Although updates should get approved relatively faster than new applications, I don’t foresee it getting approved any sooner than a week. As WWDC is starting tomorrow & I’m sure that’ll slow things down a bit. Once it gets approved I’ll make it available in the Dutch & American stores.
Tags: App Store, My Viking
Posted in Emmer Inc | No Comments »
June 2nd, 2010
It took Apple longer than expected, 9 days to be exact, but My Viking has been approved without any issues. Be sure to give it a try and report any bugs/issues using the in-app mail button or as comments on the blog. That way bugs/issues can be ironed out in version 1.0.1 which should be sent off to Apple in the coming days. Don’t worry though, no critical bugs have been found & it’s perfectly safe to install this version.
Once the 1.0.1 bug fix version has been released, My Viking will be made available in other stores as well besides the Belgian one. Specifically thinking about the Dutch & American store.
The link to the AppStore can be found here.
Tags: App Store, My Viking
Posted in Emmer Inc | No Comments »
May 27th, 2010
After a long absence in the AppStore I can joyfully announce that a new application has been submitted to Apple and should get approved any time now. The new application called My Viking is an app targeted at customers of the Belgian Mobile Vikings mobile phone operator. It allows customers to check their balance and consult the call/top-up history. All of this in a clean interface based on the default iPhone OS look & feel. Did I mention the app will be a free download and has English, Dutch & French localization?

Although several similar applications are available in the AppStore, I still pulled through and made the app since scratching your itch is a great way of making a good product.
My Viking has some distinguishing features, multiple accounts support being one of them. I won’t ask why you need it, whether to check your iPhone and iPad balance or to spy on your significant other, just know you can.

Another obvious feature, which surprisingly no other Mobile Vikings iPhone app to my knowledge has, is the cross-referencing of numbers in the call history with the iPhones address book. Instead of showing the phone number, the contacts name is displayed when found in the address book.

The last distinguishing feature is the analysis screen, this screen tries to give some meaning to your remaining balance by showing how many minutes you can call and/or text messages you can send. It also makes a prediction how many/much text messages and data you’ll have left at the end of the bundle. So you know whether to step up your text messaging rate or start slowing down.
While there are certainly some areas where the app can be improved, the call history only displays today for instance, this 1.0 release is “good enough” & postponing the release even more made no sense. The core functionality is implemented and I intend to improve/extend the app whenever I have time. Suggestions, questions and bugs may be mailed to me using the appropriate button in the extra screen.
When the app gets approved, I’ll post a new post with the link. [Edit: it's available, see next blog post]
My Viking can also be followed on Twitter: @myvikingapp.
Tags: App Store, My Viking
Posted in Emmer Inc | 10 Comments »
April 3rd, 2010
We’ve all done it, admit it, we’ve all written enormous if structures in the datasource/delegate methods of a table. It got the job done, but ever needed to change the order of the sections or needed to add/remove some rows? Things get out of hand very easily when the appearance and behavior of rows is varying. Indeed, these if structures are horrible maintenance-wise. Granted, tutorials often focus on showing some specific functionality and leave the refactoring to the reader, so aspiring iPhone developers often don’t know any better.
Here’s a way to keep your UITableViewController (or any other view controller or class your using as datasource or delegate) clean, this approach is aimed at tables with multiple sections. Tables with 1 section have limited benefit of using this approach although extra sections could be easily added later. The key is to move all the logic for a specific section in a table to its own class, which is responsible for his own rows and nothing more.
To achieve this we create a protocol called YCSectionController:
@protocol YCSectionController
@required
- (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
@optional
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section;
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section;
@end
This protocol will be used to specify to which methods a custom section controller must conform. Each custom section controller has knowledge about the amount of rows & how to display each row, these are the required methods. Extra methods can be added like what to do when a row is selected for instance. Depending on the appearance of the section & the desired behavior each custom section controller class implements the necessary methods.
The YCHeaderSectionController implementation below shows a minimal implementation.
@implementation YCHeaderSectionController
#pragma mark YCSectionController methods
- (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section {
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *cellIdentifier = @"HeaderCell";
UITableViewCell *cell = (UITableViewCell*)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
if (indexPath.row == 0) {
cell.textLabel.text = @"Yannick Compernol";
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSURL *url = nil;
if (indexPath.row == 0) {
url = [NSURL URLWithString:@"http://yannick.compernol.be"];
}
if (url) {
[[UIApplication sharedApplication] openURL:url];
}
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
return @"Info";
}
@end
One you’ve made several custom section controllers all you have to is to hook them up in your UITableViewController and dispatch the datasource/delegate methods to the custom section controllers. Note the UITableViewControllers has an array which will hold all the custom section controllers, the array is filled in the ViewDidLoad: method.
@interface MainTableViewController : UITableViewController {
NSArray *sectionControllers;
}
@end
@implementation MainTableViewController
...
#pragma mark UIViewController methods
- (void)viewDidLoad {
[super viewDidLoad];
id header = [[YCHeaderSectionController alloc] init];
id content = [[YCContentSectionController alloc] init];
id footer = [[YCFooterSectionController alloc] init];
sectionControllers = [[NSArray alloc] initWithObjects:header, content, footer, nil];
[header release];
[content release];
[footer release];
}
...
#pragma mark UITableViewDataSource methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [sectionControllers count];
}
- (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section {
id<YCSectionController> sectionController = [sectionControllers objectAtIndex:section];
return [sectionController tableView:table numberOfRowsInSection:section];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
id<YCSectionController> sectionController = [sectionControllers objectAtIndex:indexPath.section];
return [sectionController tableView:tableView cellForRowAtIndexPath:indexPath];
}
...
#pragma mark UITableViewDelegate methods
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
id<YCSectionController> sectionController = [sectionControllers objectAtIndex:indexPath.section];
if ([sectionController respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) {
[sectionController tableView:tableView didSelectRowAtIndexPath:indexPath];
}
}
@end
And that is about it, it can be taken further than I showed here, but I think this is a decent starter. The bottom line is that the UITableViewController has less code and the specific code (appearance & behavior) for each section is contained in its own class. Adding to the maintainability of the whole table.

A running example (screenshot shown above) can be downloaded here.
There’s only one thing I’m still struggling with, since id does not have a respondsToSelector: method, you’ll get a warning that respondsToSelector: wasn’t found in the protocol. An easy fix would be to add it to the protocol, but that doesn’t feel right as it’s not part of the behavior I wanted to encapsulate in the section controller. I’d love to hear your thoughts/comments on this!
Tags: protocol, refactoring, sample, UITableView, UITableViewController, YCSectionController
Posted in Cocoa Touch | No Comments »
October 16th, 2009
I received a mail from Apple 2 hours ago stating that version 1.3 has been approved, after 12 days. Version 1.3 is starting to show up as an update for existing 1.2 users. Be sure to grab this version as it adds program details and a nicer interface.

Once you have updated the app, hit the reload button on top of the Now Playing screen to fetch the extended data, which includes program details, if you have already launched the app today. Because Be Tv has already loaded & cached the data, the new version will by default just use the cached data.
Important: this version requires firmware 3.0 or newer. If you haven’t updated your iPhone yet, now is the time!
Here’s the iTunes link.

If you’re having issues with the new version, be sure to leave a comment. I already know of 2 (minor) bugs which will be fixed in version 1.3.1, so if you leave a comment, I might be able to squeeze it in the bug-fix version too. Suggestions are also welcome.
Tags: App Store, Be Tv, iTunes
Posted in Emmer Inc | 2 Comments »
October 12th, 2009
Having avoided the issue for a while now, I feel it is appropriate to air my take on push notifications in Be Tv. I have given this quite some thought and have come to the conclusion that I will not implement these in Be Tv, for one main reason.
Regardless of Be Tv, push notifications are indeed a nice feature and add some real value to applications in some cases. Yet using them to set a reminder for a certain program is in my opinion wrong. Push is intended to alert users when unpredictable things happen, a news app wants to push an earthquake news item, an instant messaging app alerts the user of a received message.
In the case of a tv guide, we know beforehand when the program is going to start and we know when to remind the user. I, as a developer, want to insert an event in the calendar and set an alarm for that. I, as a developer, do not want to setup a server pushing out reminders for something that could be handled a lot better if Apple opens up the calendar API. Push only works when the device has an active data connection, ruling out iPods (wifi isn’t a real alternative, as it isn’t available everywhere) & quite a few iPhone users without a data subscription. Calendar on the other hand is available on all devices, does not need a data connection which consumes precious battery power and is overall a better solution. It just makes sense to put it there, instead of (ab)using push notifications.
What this means for Be Tv is obvious, unless Apple opens up the calender API, there won’t be any reminders. I am aware that this decision will be met with some dissatisfaction, but feel it is the right decision. Taking into account Be Tv is a free service & I would like to keep it that way.
I hope this answers some of the questions users have asked in the last couple months. One last thing, regarding version 1.3, it’s still under review.
Tags: Be Tv, push notifications
Posted in Emmer Inc | No Comments »
October 6th, 2009
It took a while, but a new version of Be Tv has been sent to Apple for review. Be Tv has been available in the Belgian App Store for 6 months, nearing 30.000 downloads. Version 1.3 adds – as lots of people have requested – detailed program information, a freshened up interface & a few minor improvements. Nothing groundbreaking but a normal evolution. Here’s a small sneak preview:
All programs have a genre & most of them have extra information like a short comment and/or a long summary. Movies have a list of the main actors and series the episode name. There is however one huge issue which might be a showstopper for non-dutch speaking users. The extra information is in dutch, even when the interface is set to english or french. We unfortunately do not have access to translated info.

One of the small improvements is how long program titles are displayed. Long titles are cut off in version 1.2 & some of them are – even with holding the device sideways – not readable. Long titles are displayed over 2 lines in version 1.3, greatly improving the readability. Nothing earth shattering, but as said before a logical improvement.

Having said that, I think we’ve given a nice preview of version 1.3. As soon as the upgrade shows up in the App Store, I’ll post it on the blog & Twitter. One final word, for those wondering, Be Tv remains a free program.
Tags: App Store, Be Tv
Posted in Emmer Inc | 1 Comment »
July 31st, 2009
Before I made an attempt at creating a mutant iPhone, which turned out pretty good, I had a go at assembling a Minty Boost. A Minty Boost is a homemade portable charger, designed by ladyada.net, which works with regular AA batteries and has a USB plug, it’s able to charge almost anything that can be charged with a USB cable. And yes, it charges iPhones, doesn’t that sound like music to your ears?
The website lists all the parts needed, several schematics and a walkthough on how to assemble it. All parts can be bought online or you can search for them at your local hardware/electronics store. I choose to buy 2 sets online, since I had a hard time locating the IC chip in Belgium. A set costs $19.50 and contains all the parts needed, including a custom made PCB board (big plus). I choose the cheapest shipping method ($6) and it took only a week to get to the other side of the big blue ocean. Customs did ask €10 for the parts though.

The actual assembly is pretty straightforward and can be done without any soldering experience. The only thing left to do now, is fitting it all in a little box. I’ll post some pictures of the actual finished product, once I find a suitable metal box.

Tags: DIY, electronics, Minty Boost
Posted in Emmer Inc | No Comments »