iOS

An Easy Way To Use Contact Picker

API for selecting a contact in iOS seems unnecessarily difficult, it becomes a nightmare when you have to use it again and again at different places in your project. I think the idea of delegates is over-used in iOS, and they could have made things much simpler by relying on blocks instead.
read more »

iOS

Mimicking JavaScript’s alert, confirm and prompt in iOS

While some people argue against these functions, I think they are pretty good tools for rapid prototyping. And I really missed them in iOS, so I created similar functions in my iOS projects. Here is how they can be used:
read more »

iOS

How to make scrolling work on an iOS app screen?

Among many other things, scrolling is one that we take for granted when developing web apps. As soon as content grows beyond visible screen, good browsers themselves add scrollbars to the screen. Try making it work on an iOS app screen, you’ll be surprised how tricky this thing can get.
read more »

iOS

Taming UIAlertView

There are a few things in iOS development which are surprisingly difficult, UIAlertView is one of them. If your UIAlertView contains only one button, which cancels the dialog, things will be easy. But as soon as you’ll think of adding more buttons to it, you’ll realize that you’ll need to create a delegate class and assign the delegate to the UIAlertView instance. This is ridiculous, because given the frequency of use of UIAlertView, you’ll end up creating unnecessary delegate classes.
read more »

iOS

How To Extract String Reference To An Image In iOS And Then Load The Image Later?

Recently I had to create this flow in one of my projects:

  1. Let the user select an image from the gallery.
  2. Store the image reference to Core Data.
  3. Later, load the image from the gallery using the saved reference and show image again to the user.

Here is how I did the job:
read more »

Hacking Into A Java Class

Official Java Docs may call it Anonymous Inner Classes or name it with some other heavy-weight formal jargon, but I would like to call it hacking into a Java class because with this technique you can inject your code into an existing class method.
read more »

How To Create A Maven Webapp In Eclipse?

I like Maven because it makes dependency resolution easier and I like Eclipse because it is lightweight (at least lighter than other Java IDEs) and configurable. But I hate when it comes to creating a Maven webapp in Eclipse because it is overly complicated. Till the time a simpler solution appears, here is what you need to do to create one:
read more »

Java Nested Classes In A NutShell

The Java programming language allows you to define a class within another class. Such a class is called a nested class and is illustrated here:

class OuterClass {

...

    class NestedClass {

     ...

    }

}

read more »

The BackboneJS Way of Thinking

So you are frustrated tackling BackboneJS and wondering why it isn’t solving your problems as you had expected it to, after hearing about its glorious penetration in many high profile projects. Well, join the club, you are not alone. Here I’ll share my expectations when I imported BackboneJS for the first time in my project and my learning that I gained after weeks of trial and error and frustration.
read more »

Why Backbone-Relational Sucks?

Apologies for being blunt, but this is what I truly feel after weeks of struggle with Backbone-Relational. Some of the features library boasts are great, but some other problems make its usage horrible. So if you are lured by the cool features this framework claims, here is my candid advice: keep some Disprin tablets along because it is going to give you some serious headaches.
read more »