Tag

Rant Archives - Cobi Interactive

When you wish you had a strongly typed compiler!

By | development, iPhone, Rant | No Comments

The other day a work colleague of mine ran into some troubles with an unrecognized selector exception crashing his iPhone application…the exception looked something like this:

NSInvalidArgumentException’, reason: ‘-[__NSArrayI addObject:]: unrecognized selector sent to instance …..’

After much frustration, and a fair bit of time spent with a bunch of us trying to hunt down the problem, it turned out to be a problem that could have been noticed immediately had the compiler been strongly (stronger) typed. Yes, ultimately the problem arose due to programmer error, however, this particular instance is just one example of why I prefer strongly typed languages (such as Java).

The error came about as a result of attempting to add an object to an NSMutableArray type that was actually pointing to an NSArray object. This type of scenario is shown in some demo code below:


NSString *test = @"test";
NSMutableArray *mutableArray = [[NSMutableArray alloc] init];
[mutableArray addObject:test];
NSArray *immutableArray = [[NSArray alloc] init];
mutableArray = immutableArray;
[mutableArray addObject:test]; // Exception: unrecognized selector

From the above code, it is easy to see that a subclass type is being assigned to a superclass type. In Java, for instance, this would immediately have been flagged as an error (conversion error between types), and the problem resolved fairly quickly. To be fair to Objective-C, a warning is given when attempting to perform an incompatible assignment, however, this simply just does not seem to be enough sometimes and the result can be a real pain for developers. Fortunately, this time around, it was not myself who bore most of this pain 😛

BlackBerry Dev is Horrible: reason 4

By | BlackBerry, Mobile Development, Rant | No Comments

Take a look at the BlackBerry API reference tool-tip above – the descriptions of the url and cookie parameters have just been left blank. Fortunately in this case the parameter names make their use self-explanatory, but in other areas of the API reference this kind of incomplete or often poorly described documentation makes development more difficult than it needs to be. How hard can it be to ensure that the API reference docs are complete?

Symbian: Going nowhere fast?

By | Rant, Smartphones, Symbian | No Comments

Research companies Gartner and IDC predict that the smartphone operating system market will remain dominated by Symbian in 2014, followed by Android in the No. 2 spot. AllAboutSymbian.com provides a summary – along with some unreasonable Symbian enthusiasm – of these predictions with some graphics relating to the future growth of the different platforms.

So, the bad good news is – that is if Gartner and IDC are correct – is that we have at least 3 uplifting years of  unobscure, well-documented, Symbian development to look forward to. I’m pumped. Not.

BlackBerry is Horrible: Reasons 2 and 3

By | BlackBerry, Mobile Development, Rant | No Comments

These two go hand in hand so thought I’d post them together:

2: BlackBerry’s almost always seem to require a restart when you update or install over an app or library. BlackBerry’s take possibly the longest of all devices to restart. As one forum poster put it: “If I have to reboot mine I go and take a nap or read War and Peace.” This makes testing on the device a wonderful experience.

3: BlackBerrys seem to have a single class loader, but no unique namespace assigned to each app. This means that you can’t have two classes of the same name loaded at once. So if two apps use the same package / class name or if you want to build seperate instances of a shared library for multiple apps…well…you can’t without the pain of refactoring. If you try to load multiple classes of the same name, the device doesn’t complain, it just seems load the first class and quietly forgets about the 2nd one. In practice this can make developing, testing and releasing apps for BlackBerry a nightmare in certain but fairly commen circumstances.

These issues were pointed out as far back as 2006 by worried developers; and now 4 years on, the problem’s still seem to exist.

Go BlackBerry.

BlackBerry Development is Horrible in So Many Ways: Part 1

By | BlackBerry, Mobile Development, Rant | No Comments

As much as BlackBerrys are reasonably sturdy devices when it comes to simple access to various communication channels (albeit doing it with the most profoundly boring interfaces ever); their weak attempts to lure developers away from iPhone and Android are extremely frustrating; as is their development environment. After developing for BlackBerry for a year now, I’ve come across one too many flaws in the BlackBerry dev environment and programs and need to vent – this could be a long series of posts…

First up is a look at their very average website – I’ve only ever had this error happen on the BlackBerry website…numerous times…and yes I have cookies enabled.