I would sound naive if I will try to emphasize on how important testing is for building a high quality application. Be it a consumer mobile or web app or large scale enterprise application. I have been playing with iOS ever since the first SDK was released. And hence, worked with so many customers, clients, enterprises (starting from startups to fortune 500 companies).

And I think about 80% of those customers or clients prefer to do their testing manually and track the test results in excel or Bugzilla which is always time-consuming and requires a significant amount of man-hours every time we want to do a proper testing. iOS apps now supports automated Unit testing by default. But Unit testing only ensures that an unit of your code works properly and doesn’t guarantee the application will run properly under all circumstances.

Cedar is a BDD-style testing tool for Objective-C similar to rspec in Ruby. The documentation available online is bit old and doesn’t really work with iOS5. Hence, I would jot down few quick steps on how to use this tool.

1. Download the framework from GitHub: https://github.com/pivotal/cedar

2. Build Cedar-iOS static framework. You might want to change the default “Derived Data” directory path from its default location to the your project directory. So that you won’t have to look up in the archive of your application folder to find the static library.

3. Add these flags under “Other Linker Flags” in your build settings. -ObjC, -all_load, -lstdc++

4. Add Cedar-iOS static framework to your project.

5. Comment out the default codes on main.m and add the below lines which will launch CedarAppDelegate in stead of your application AppDelegate. Another way you can do this is to select UnitTest while creating your project and modify the main.m under the test directory. So whenever you will test the application it will launch Cedar.

#import <UIKit/UIKit.h>
#import <Cedar-iOS/Cedar-iOS.h>

int main(int argc, char *argv[])
{
	@autoreleasepool {
		return UIApplicationMain(argc, argv, nil, @"CedarApplicationDelegate");
	}
}

6. Create a new (c++) file called AdditionSpec.mm and you can write your test specs on this file. You can use matchers, mocks and stubs. For these things you can refer to the GitHub project.

#import "SpecHelper.h"
using namespace Cedar::Matchers;

SPEC_BEGIN(AdditionSpec)

describe(@"BehaviorSpec"), ^{
	it(@"addition should work properly"), ^{
			1+2 should equal(3);
	});
});

SPEC_END

7. Build and Run. It will display all the test results in a table view.

Let me know if you face any issues in building or running it. Happy Testing. ūüėČ

As usual rumors have started to hit the Internet about the release of iPad3 towards end of March 2012. Among the so called expected features as per the below articles particularly two are interesting. http://www.thetechlabs.com/tech-news/ipad-3-features/

One is the “3D Feature and New Retina Display” and another one is “Fingerprint Proof”. The reason I feel they are more than just rumors is because I’ve¬†recently read some patents being filed by Apple on both of these technologies.

Patent filed on displaying 3d environment : http://www.patentlyapple.com/patently-apple/2012/01/apple-is-paving-the-way-for-a-new-3d-gui-for-ios-devices.html

In consumer market it will definitely allow users to create 3D content by taking 3D images or 3D videos using their smart phones or tablets. But it will also¬† give a boost to technologies like 3D Modelization, Augmented Reality creating¬†opportunities for innovative enterprise solutions. 3D display environment on¬†a smartphone or tablet would definitely bring in great visual nonetheless.¬†Many people talk about Near Field Communication (NFC) although it’s not yet supported¬†on iOS and a fairly new technology on Android. But if fingerprint proof or mobile biometrics come to smartphones, it will literally kill NFC before¬†it is being adapted¬†by users. Because, mobile biometrics is more secure than NFC where user’s identity or secret key is thumb impression. Imagine, fetching medical history or checking¬†into airports just by taking finger prints on a¬†smartphone or tablet.

Patent on fingerprint proof: http://www.patentlyapple.com/patently-apple/2011/08/new-patents-surface-for-an-iphone-antenna-clip-solar-energy-and-a-new-oil-resistant-coating-for-ios-devices.html

At the end, as we all know the above discussions are still rumors but we can’t deny the fact that technologies like this are going to make smartphones and tablets much more interesting than they are today.

# Omni Omnigraffle + iOS Stencil (Paid): http://www.omnigroup.com/products/omnigraffle/

Get Stencils from: http://graffletopia.com/

# Sketch-kit Keynote Template: (Free) http://www.extrathought.com/sketchkit/

# Photoshop PSD Files (Free)

iPhone PSD: http://www.teehanlax.com/blog/iphone-gui-psd-v4/
iPad PSD: http://www.teehanlax.com/blog/ipad-gui-psd/

Other Options (Around 21 Different Tools): http://goo.gl/SwU2b

Summary: Use the tool you are most comfortable with. For example if you are familiar with Keynote then use Sketch-kit or other keynote templates. I personally prefer OmniGraffle. Best way to judge is: check the sample screens or video of these tools and choose the one you like the most. ūüôā

iOS 5 introduced a new feature called Automatic Reference Counting (ARC) few months back. My initial assumption was – either it brings in garbage collection for iOS Development or memory is released by compiler on a certain period of time like how it works for autorelease pools. But when I dived more into ARC I found it it’s neither of the above and it’s something much more powerful which makes the life of programmer easier.

In XCode 4.2 the new LLVM compiler reduces the effort of developers by automating the process of memory management. So developers don’t need to manually retain, release or autorelease objects. However, to repeat again – this is not garbage collection, ARC just automates the memory management process similar to how syntax checking is done as you type. You can create a new XCode project by selecting to use Automatic Reference Counting or you can also refactor your existing codes to Objective-C Automatic Reference Counting format.

But few things to remember once you do so:

1 – retain, release, autorelease, retainCount methods won’t work

In ARC mode retain, release, autorelease, retainCount and similar manual memory management methods are obsoleted. Usage of these methods will give compiler error as above. Memory of an object is retained, released and managed automatically by compiler based on two primary things.

  • Scope of the Object
  • Its property attributes

2 – dealloc method will be missing from classes

By default dealloc method will be missing from Objective-C classes. dealloc() method shouldn’t be called explicitly rather it gets called when an object no longer has any owner or in other words the retainCount of an object becomes 0. If you need to reset any of the state information or release any resources which are not instances of the class you can create a custom dealloc() method which gets called when the object no longer has any owner. However, you shouldn’t call [super dealloc] as that will be enforced by the compiler.

3 – retain, assign, copy “@property” attributes are no-longer used

In stead of retain, assign, copy “@property” attributes, ARC uses two new attributes to declare the property of the variables.

  • weak : a reference to an object that does not stop it from being deallocated. (Used in place of copy or assign)
  • strong : a reference to an object that stops it from being deallocated (Usually used to retain the variable)

4 – Use @autoreleasepool{} blocks in stead of NSAutoReleasePool

You must not use NSAutoReleasePool objects in ARC compliant code, instead use the @autoreleasepool{}blocks. Refer to main.m file in your XCode project to see how it uses @autoreleasepool{} block in stead of NSAutoReleasePool that was being used earlier.

You can find more about Automatic Reference Counting from the official site.

I took this initiative a month ago to help students, developers or start-up founders to get started with¬†iOS Development. I closed the registration in a day with 35 interested participants. Many people, asked me¬†why I haven’t kept any registration fee for these sessions. The idea is very simple – I have learnt so much¬†from open source community – Unix, Php, JavaScript, Ruby on Rails, and iOS. Although iOS is not exactly open source but I still like the idea of Apple of bringing an app development SDK and making it open for other developers to put their apps on iOS Devices. The idea itself showed ways to a lot of people. And as I have learnt so much from this community, I want to give something back to the community. It’s more of a passion for me than a business. In one way, you can say I am helping my friends than helping someone I don’t know. And I wouldn’t ask money to a friend for my help. ūüôā

Yesterday was the first session, and it was almost a full house At HackerSpaceSG. Thanks to Jason Ong for¬†helping me to organize the event at HackerSpace. Together with all the awesome participants we explored and¬†revealed XCode basics and Objetive-C syntax through a little program called “SaveThePrincess”. At the end of¬†the session, I got some honest feedbacks. Where most of them said it was helpful, some couldn’t follow. Mostly¬†people who couldn’t follow are from non-programming background. So I thought what I could do better that will¬†help those set of people. My approach of this tutorial was to start with something basic and build components¬†on top of it, which although assumes participants have basic programming knowledge.

Then Jason and few others¬†suggested, we could reverse the approach. For example: show everyone, what’s the end product and then build¬†individual components that’s required for the actual product. I am still looking for an interesting way to do¬†it. But for sure – I decided I will show an application in next class before starting the tutorial. That might¬†be fun for all the folks who wants to save our little princess. If you have any suggestions feel free to drop¬†few lines here.

The materials of my first class can be downloaded from BoxDotNet. Our friend Calvin has explained more about the session on his blog. 

Ever since I installed iOS5 Beta firmware, I was curious to try out iCloud. It has so many amazing features like new notifications, over the air print for map, camera grid, better photo editing options to name few. Everything else was working except iCloud. Every time I tried it used to say “Your Apple ID is correct but the device is not registered/eligible for iCloud”. I thought may be it has something to do with the hardware.

Earlier today my friend told me that iCloud beta is released, and curiously I tried again and it worked and worked like magic.

For those who are listening first time about iCloud, this is a content integration platform which integrates all your contents and makes it available on all your apple devices like iPhone, iPad, iPod Touch and Mac. Everything happens over the air (wirelessly). Not only that, it makes all the app purchases available to all your devices. Apart from synchronizing it takes a back up of all the data (currently up to 5MB) and make it available on cloud. So if your device gets crashed, you don’t loose the data ever.

In this beta release it has got the following features:

  • Mail : Synchronizes and takes backup of mails in your inbox and makes it available on other devices
  • Contacts : Synchronizes and backs up your contacts
  • Calendar : Synchronizes and take backup of your Calendar Events
  • Find my iPhone: Locate your device, send message, lock and wipe data
  • iWork: Office suite, backs up all documents, presentations

The first look is amazing with future scope to support photo, music, app, video synchronization. Won’t be surprised if they plan to store the snapshot of the system like how they do it on time machine.


Earlier this week, I was having a pep talk with one of my friend who I met couple of months back. We are kinda working together, trying to solve an interesting problem and sharing our passion in the course of it.

At one point of time, he asked me – “What do you want to do with your life?”

For sure РI want to have my own venture in a year and want to work on an idea or possibly couple of ideas that will be valuable to people who will use it. Again defining valuable РI meant making the life of people (can be of any group) simpler and interesting to live. There are several such product ideas in my mind, most of it are fuzzy and unstructured at the moment, some of it are not even ideas I would like to implement.

Most importantly I want to work on certain idea which is really interesting for me to work. And if an idea is something that I would like to work on after 2 years or 5 years then I consider it as an interesting idea.

Then he said – Don’t worry so much about the ideas or product at the moment. There are three¬†major components of any business. Basically the 3Ps – People, Process and Product. While most of¬†the people are focused on Product & Process in terms of what they want to do, how they want to¬†do; they almost forget about the first component which is the most important component of all.¬†Probably they think, they can get people from anywhere if they have money or connections, which is¬†not entirely true in many cases and in most situations they compromise on the kind or attitude of¬†people they work with.

So it’s very important to find people with whom you want to work. There are various problems in¬†this world to solve. So it doesn’t matter what you will work on or how you will solve the problem.¬†As long as you are working with the people you like and people who shares the same passion, any journey is gonna be fun.