February 23, 2010

Tackling that handy index on the right side of table views is really not that complicated. In fact, it only requires that you implement two methods. In this tutorial, I’m going to take you step-by-step on how to wire it all together.

Indexed Table 2

Read full article »

January 13, 2010

FutureTap and Edovia have released an open-source framework that gives developers the ability to offer app settings inside the app as opposed to having it only in Settings.app.

The way settings are used today is by specifying Settings.bundle and Root.plist files in your project. This lets Settings.app know about your app and its settings. The obvious downside of this approach is that app settings are separated from the app itself.

InAppSettingsKit uses a hybrid approach to this problem. It still uses the same resource files to create your settings bundle. However, your settings will be available both within the app and in Settings.app. This is great because you don’t have to create any additional metadata files to support this feature while still maintaining the existing functionality.

I’ll play around with it a bit and post back with a report. For now, head over to FutureTap’s or Edovia’s blogs for release notes and more information.

October 26, 2009

I will be attending an iPhone Tech Talk this Thursday in San Jose. It’s going to be my third one so I wonder if the structure has changed. These talks are usually like mini-WWDCs – packed with information-rich sessions and a party at the end. Last year’s event was a mixture of different WWDC sessions from that year’s conference so I expect something similar this year as well.

The first one of these back in 2007 was still pre-SDK.  It was primarily concentrated around web-based apps. This is when I developed CiUI to serialize production of web-based apps. CNET is still using it (http://reviews.cnet.com/4250-1-0.html) but development of their mobile sites has since been handed over to CBS Mobile.

In any case, if any of you are going to be in attendance this Thursday, hope you come say Hi!

September 17, 2009

Tab bar based apps are probably as common as table-based apps and it’s even more common to see them combined. That’s what we’re going to do in this tutorial.

There is a very easy way of creating a tab bar application. In fact, it’s so easy it requires no work whatsoever. When you choose to create a new iPhone application in Xcode, one of the options is Tab Bar Application. Just the bare-bones template provided by Apple gives you a fully-functioning app with two tabs. That is not what this tutorial will be about. We are going to create a tab bar controller programatically. It’s really a lot easier than most people think.

Prerequisites

This tutorial is a continuation of my previous tutorials so if you haven’t followed them, it’s a good time to catch up.

We’re going to be starting off from a slightly modified version of the previous source code. You can download the primer code for this tutorial here: MyDVDLibrary04Primer. The only changes made were some name changes (DetailViewController became DvdInfoViewController) and I organized all classes into groups.

Also, I’ve recently upgraded to OS X Snow Leopard + Xcode 3.2 with iPhone SDK 3.0 (not 3.1 yet) so the project was compiled on that platform.

Read full article »

August 23, 2009

tutorial019

I’m going to build this tutorial on the previous two so if you haven’t checked them out yet, you can see the first one here and the second one here. You can also download the source code on the bottom of each tutorial.

What we’ve done so far

We used UITableViewController to build out our root view controller that lists all the DVDs from our data file. Then we customized each cell by adding a DVD cover and some basic info about each movie. Tapping a row in the table caused the app to go to a detail page which was also a table displaying expanded info about the selected movie. That’s the part we’re going to work on now.

1. Download some source code to get your started

Since we’re going to be completely removing the detail view controller we used in the previous tutorials, let’s just start from there. Instead of walking you through deleting the controller and removing the appropriate functionality, download this source code that will get you started. You’ll get the root view controller with customized cells in it. However, tapping on any of the rows won’t do anything, yet. Download the primer project here: MyDVDLibrary03Primer.

2. Enhance test data file

Since our test data file only contains title, length, image and release date for each movie, that’s not going to cut it when trying to design a detail view page. We’ll at least want to add the description of the movie and maybe also its genre. This can be very tedious to do in a plist like we’re using right now but it will get a lot easier once we start using Core Data that I will cover in later tutorials.

I won’t make you add all the data by hand so for a shortcut, download the completed plist file here and replace your existing one that can be found in Xcode under the Resources folder: TestData.plist.

3. Create new DetailViewController class

In Xcode’s file browser on the left, right-click on the Classes folder and choose Add -> New File… . Under Cocoa Touch Classes group choose UIViewController subclass and make sure to check the With XIB for user interface checkbox. This will not only create our subclass but also the NIB file that we’ll use to layout our UI components.


tutorial015

Read full article »

July 21, 2009

If you followed my first tutorial on UITableView (linksource code), you now have a very simple app that shows a list of DVD titles and clicking any of the titles shows you a detail view page with more information about the DVD.  That’s all nice but we really want to make it a little bit prettier. We could display the length of each movie right on the listing page. Also, we have this coverImage field in our data set, let’s use it.

What we want is for our home screen to look like this:

tutorial006

We can accomplish that by customizing UITableViewCell. There are 2 ways of going about it:

  1. Using Interface Builder
  2. Programmatically

In reality, you can also choose a hybrid approach where you create some UI elements in the Interface Builder and some programmatically.

Which option to choose?

The two approaches both bring some advantages and disadvantages with them.

Interface Builder

If you decide to go the Interface Builder route, you’ll find it very easy to create and customize your cells. Any subsequent edits can also be done quite easily since you’re simply rearranging elements visually. The downside is speed and performance since the system needs to render each view in a cell individually. If your table view has thousands of rows in it, this may/may not affect the performance of your app, depending how complicated your cell is.

Programmatically

This one involves a lot more work. You are responsible for creating each UI element by hand in the code. That can be very tedious and any edits you need to make in the future require code changes. Also, you’ll need to set up all the autosizing masks yourself. The upside is performance. Since the system will draw each cell as one view, the performance gain can be very significant.

Read full article »

July 2, 2009

Ok, let’s start with something really simple. We’ll be creating an app to keep track of your DVD library. The app will have a table view, a detail view and some basic navigational components.

Pre-requisites

I assume you have Xcode and iPhone SDK 3.x already installed (I’m using version Xcode 3.1, with 3.2 being the newest at the time of this writing). I also assume you know how to create a project so I’m not going to cover those little things here. Lastly, I assume you have some knowledge Objective-C, its principles, syntax and paradigms.

1. Set up your project

Create a “Navigation-based Application” and name it “TableViewApp.” Right off the bat, you’ll have an empty app, which is pretty much useless. You can run it using Cmd+R.

2. Create a dummy data set

Right-click on the Resources folder and choose Add -> New File. Under Other category, choose Property List. Name it TestData.plist. This is basically an XML file that will have an empty Dictionary in it by default. Change Dictionary to Array since we’re going to be adding numerous “DVDs” which will be described as individual Dictionaries.

tutorial001

You can add data to it by simply clicking the little button to the right of the Value column. We will be adding information about your DVD collection to it so the schema of your data set could be something like this:

  • Title – String
  • Cover image – String
  • Feature length  - Number (in minutes)
  • Release date – Date

Of course, this could be extended to more fields such as director, genre, aspect ratio, etc.

Following this schema, add a few items to your dummy data set. You’ll eventually want to have your file looking something like this:

tutorial002

If you don’t feel like typing all this info in, you can download the file here: TestData.plist.

Read full article »

March 6, 2008

Apple has finally released their SDK today. A week behind the schedule but at least it’s here.

Along with this announcement came another one. Enterprise services are getting a huge boost by supporting the push technology, Cisco IPSec VPN, Certificates and Identities or WPA2, among others. However, the biggest one is support for Active Sync and Microsoft Exchange. These new enterprise features will be available via June’s software update (free for iPhone, paid for iPod touch) and is also available in beta for US-based businesses that qualify.

The SDK is now available for download on ADC.

The technologies used in the SDK are divided into these layers:

  • Cocoa Mutlitouch
  • Media
  • Core Services
  • Core OS

Cocoa Touch

Cocoa Touch layer lets you access technologies such as Multi-touch events, Multi-touch controls, Acceleromter, View Hierarchy, Localization, Alerts, Web View, People Picker, Image Picker or Camera

Media

This one will probably get the most attention. Especially with combination with Cocoa Touch. You get your hands on Core Audio, OpenAL, Audio Mixing, Audio Recording, Video Playback, JPG, PNG, TIFF, PDS Quartz, Core Animation and Embedded OpenGL

Core Services

Core services is more lower-level oriented and will make a lot of sense for business-like apps. It includes Collections, Address Book, Networking, File access, SQLite, Core Location, Net Services Threading, Preferences, URL utilities

Core OS

And finally, the OS layer lets you really optimize you app by talking to low-level services such as OS X Kernel, BSD TCP/IP, Sockets, Power Management, Keychain, Certificates, File System, Lib System, Security, Bonjour

Requirements and what you’ll get

You will need to have Leopard 10.2 installed on an Intel machine to use the SDK. It comes complete with enhanced Xcode and an iPhone emulator. I just downloaded it (their site is currently very slow) and will be trying it out. I will write up a post once I play with it a bit. I’m so excited, YAY!! :)

January 21, 2008

My name is Vladimir Olexa and I currently work as a software engineer for CNET Networks. I’m the creator of CNET’s iPhone app.

As an iPhone developer, I want this site to be a good resource for tips, tricks, tutorials, articles and other material that will help all of you interested in iPhone development get started and get developing.

Copyright © 2009 Vladimir Olexa | Copyright © 2009 Apple Inc. | Powered by WordPress