Resetting / Reloading UISegmentedControl

Thought of sharing as quick google didn’t land me to the solution. If you want to reset the UISegmentedControl to a state where nothing is selected (this was the requirement for me), then you just need to set its ‘selectedIndex’ to -1. Reminds of C (EOF character = -1 :)). Here is the snippet I wrote on click of reset button:-


NSArray *segmentedControls = [NSArray arrayWithObjects : roadTestConducted, validVehicle];

for(UISegmentedControl *segControl in segmentedControls) {

[segControl setSelectedSegmentedIndex:-1];
}

Hope one finds this useful

From Java to iOS

It’s not going to be easy, as it appeared to me in the first place. Registered as a free Apple developer few weeks ago. If I found it interesting, then I hope to buy the 99 USD membership soon.

The Xcode IDE, is  not that much rich as eclipse or visual Studio 2X series and I can already see it is going to be a challenge. The web domain is already evolved, so are the development tools, but the mobile domain is still in a inchoate state.

I am making a tab based iPad application (should work in iPhone as well) for my company people, as they travel to remote locations. Haven’t figured out the architecture yet, but roughly it is going to be they will save the information in the SQLite DB that they would be having in their Apple device and then, when they would be back to office, the data would be synchronised with the central database (most probably MySql).

Looks like a tough stone as I don’t know the basics of objective-C yet. Let’s see. Will keep on posting.

Sorry for any grammatical/typo. I don’t read it before publishing as this is a tech post. It should convey the point though 😀