Don't answer to twinkle toes, its not manly!
Halló world!
I've done a lot of work on my project over the last few days in the navigation department, best described by these pictures!
- Browse.
- Browse all products.
- Browse by country.
- Select Japan in country subcategory.
- Search Japan products.
- Search results for Japan products.
- Browse by style.
- Browse by distillery.
- Browse by price.
At the bottom of the screen I've added the tab bar control that will allow the user to switch between browsing products and their three lists (wish list, shopping basket and collection). Currently the three lists are multiple instances of the same view that is currently empty as a place holder. In the browse section you have the ability to either browse all products, or browse by a category such as country, style, distillery or price range. Clicking on any of the categories takes you to a view where you can select an option within that category. Clicking one of those (or all products on the top level) takes you to the product list view, where the products for that section are populated.
I've broken up the product listings by letters of the alphabet, which you can jump between using the bar of letters down the right hand side of the screen (which really helps with long lists). On the product list view you also have the option to use the search box at the top to filter the current list of products by a search query.
Both this site, and this one were very useful in showing me how to break up the product list by letter and add the letter index on the right. I didn't end up following their exact implementations as they weren't quite fit for my purpose. Instead I used a single NSMutableDictionary which contained an array list of products for each letter of the alphabet. I then used an NSMutableArray to store all the letters the current product list actually had (there are only 24 letters in the all products list for example), so that I know what to display in the index and which letters to query the dictionary when building the list.
The first site also had a tutorial on how to build a search box, but after some more research I found out that in 3.0 of the SDK Apple added a UISearchDisplayController which basicly does all the work for you. They have some great documentation for this object over here.
All you have to do is create and add a search bar to your table view and then attach the search bar to the search display controller. From here everything is mostly handled for you and you can use some delegate methods to update the datasource of the table view for the query searched.
- (void)viewDidLoad {
if (!self.tableView.tableHeaderView) {
// Add the search bar
UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 45)];
self.tableView.tableHeaderView = searchBar;
UISearchDisplayController *searchController = [[UISearchDisplayController alloc]
initWithSearchBar:searchBar
contentsController:self];
searchController.delegate = self;
searchController.searchResultsDataSource = self;
searchController.searchResultsDelegate = self;
}
}
In non-project news, the week before last I started learning how to build a proper WordPress theme. I've dabbled in WordPress before, most using other peoples themes or hacking a pre-made theme to my need, however it seems a lot simpler just to start from scratch. I've been the webmaster of the Final Fantasy VII Citadel for a little while now, but I've really neglected it due to other commitments. One of my biggest desires has been to move its static html pages into a content management system and generally modernise the look of the site, without loosing its look and feel. I took a look at a lot of pre-made WordPress templates, but finally accepted I wasn't going to find anything quite right.
I'm using some of the images of how the site used to look like back in 2001, 2004 and now as some of my inspiration to try and keep some of the look and feel. This is how it currently looks, although obviously there is still a lot to do. Feedback is most welcome!
Inspired by working on a new version of the Citadel, I fired up Final Fantasy VII on my PS3 and ended up getting 40 hours into it (I'm at the start of disc 3). It's been a long time since I had a working copy of the game (my disc one is fucked, so thank you PSN), and man did I forget how much I liked the game. I'm thinking of marathoning through VIII, IX and X once I finish this one, just for the hell of it...
Today was the first day of the second (and last!) semester of my University degree, so it really should be all work from here, but you gotta relax sometime right? Last week I (finally) completed a project I've been doing at work for the last few months (I built a stock ordering system for them, its not at all exciting), so I plan to do a lot less for them in the next couple months (except for my project of course) as we lead up to deadlines and exams.
Oh, I almost forgot; after two weeks I finally got my MacBook back from Apple (if you don't remember, the backlight was turning off at random). If you Google the issue it seems to be a common problem with an "inverter board" (an £18 part) which the Genius said was probably the issue when I took it in. When I picked it up they had replaced the inverter board (which hadn't fixed the problem), logic board and lcd, plus they gave me a new palm rest, keyboard and track pad (the second one in a year) because it was showing signs of getting the crack of doom again. In all a £18 repair became £650 including VAT. Thank God I got the student Apple Care for just £40. Including the palm rest repair last year, Apple has spent over £750 repairing a machine I only paid £800 for. I'm surprised they still like me...

Monday, February 7, 2011 at 10:16PM