Tag Archives: xcode

KPI time!

OK… so it is now officially the end of the working year and I was thinking the other day about a few things I have set for myself to have done by the yearly reviews next year in July.

One of my ‘KPI’s’ was to have an iPhone application submitted to the app store. Now I just remembered this and thought I better get cracking and get an idea together for an app that would be useful to people. In saying that, I have come up with my idea, and I will reveal once we are published in-store!

Something that I came across for the app I am creating, is that the user must have an internet connection to use it. Apple are very kind and have provided a class called ‘Reachability’. This class checks to make sure the user does have a connection and if not, then warns the user the app is not going to work until they manage to get one. Having no internet connection and not warning the user about it, is the (according to Apple) third most reason for an app to be rejected.

The ‘Reachability’ code can be found on the Apple Developer site

Now that I have got this under control… I know what i’ll be doing over my Xmas break!

Yours in iPhone development,
Lee

iPhone UITableView Selected State

While playing around the other day in Xcode, I wanted to change a row of a table view to a different colour other than blue when selected. Now after having a look high and low for a solution, I figured I would throw a few things at it and see what I could come up with. I managed to sort it all out by using the below code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
cell.selectionStyle = UITableViewCellSelectionStyleGray;
}

With ‘cell’ being the UITableView row, you can use the above to change the selected state to gray. Other options available are:

UITableViewCellSelectionStyleGray (demonstrated above)
UITableViewCellSelectionStyleBlue (default)
UITableViewCellSelectionStyleNone

More information can be found here.

Yours in iPhone Development,
Lee