Sunday, February 8, 2009
at
2:11 PM
|
Chapter 4 of Beginning IPhone Development. I finished a few other tutorials that taught some simple concepts and I've uploaded the source code. One of the cooler things I messed around with was the auto rotation. For simple things, you can have the IPhone do most of the work in figuring out how to change your application when you rotate it. Or you can just design seperate interfaces for different orientations.
Thursday, February 5, 2009
at
2:25 PM
|
I started doing a simple Picker application based on a tutorial from this book. What I like about this tutorial is that it outlines the basics of everything I need to do even though the tutorial is several chapters into the book. This book seems to really be reinforcing the principles that people should have when developing. The most important/most basic I think so far is to keep the Model/View/Controller design philosophy in mind. The tutorial guides you through making 5 different tabs, each tab has it's own view so each tab will also have it's own controller. Thats pretty straight forward.
Here are some pictures from this tutorial:
It's been a hectic few weeks trying to get my SDK sea legs underneath me but I think I'm off to a decent start. Here's a summary of the things I've learned so far to help my curriculum design go a little easier:
- Introduction to the SDK
- Model View Controller
- I really like this book so far
- Seperate the model, view, and controller.
- Think of the model as the SDK itself, tying everything together.
- The view is what you make in the interface builder.
- The controller is what you code in Xcode
- Simple View Based --> One view, one controller (HelloWorld, ControlFun, TempConverter)
- Connecting things --> Page 48
- Multiple View Based --> Tab Bars, multiple views, multiple controllers (Picker)
I'll try and post more later.
Tuesday, February 3, 2009
at
9:05 PM
|
I'm working on a tutorial from the IPhone Development book I posted a link too. I came across something that I hadn't seen before.
- (NSInteger) pickerView: (UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { return [pickerData count]; }
At first, I wasn't sure what this meant so I did a little research. It looks like it has two method names. It sort of does. This is how you pass multiple parameters to a method in Objective-C. The method is pickerView:numberOfRowsInComponent and it takes as parameters (UIPickerView *)pickerView and (NSInteger) component and returns an integer.
Monday, February 2, 2009
at
8:28 PM
|
The SDK has several templates to help make some of the coding/linking up easier. I know I've rehashed these first two tutorials a dozen times but I 'm going to do it again using templates.
For a simple view you can use a view based template. Create a view based template project and you'll be presented with many things already set up. The code is similar to the code from the first tutorial except you're given more to start with. Also in the interface builder you don't have to link up as much. All you have to do is link the things you put on the view to the files owner. I tried figuring out the Tab Bar template and could not. I think for now I'll stick to making these from scratch as it will help enforce some good programming practices.
Check out this book by the way, I like it so far.
I came up with an idea for a great IPhone application. When I go running I like to run to music that matches my pace. I thought it would be really cool to have an application that could do that. The way I thought it would work would be to use the accelerometer to calculate your pace and then pick a song from the library to use based on that. I did some research and stumbled upon SynchStep which is a program that does pretty much exactly that.
I did learn some interesting things however from emailing Greg Elliot, the developer. The IPhone has a few limitations. One of them is that you can't access other applications from an application you develop, including the music library on your phone. To get around this, Greg didn't use the IPhone SDK and the program only runs on jailbroken IPhones. Really cool stuff but for now I'm just looking at the IPhone SDK for starters. He did direct me to a good resource, Erica Sadun's, The IPhone Developer's Cookbook. I'm going to get my hands on this and go through it and see what it has to offer.
Sunday, February 1, 2009
at
5:50 PM
|
There are several different ways of constructing a lot of this simple GUI based apps. I'm trying to come up with a standard way to do certain ones of the same kind. Here are the steps I've followed to make a Tab Bar Controller.
1) Write the code first (I followed this tutorial) 2) In the GUI, drag a Tab Bar Controller item 3) Add views 4) Make a connection from Tab Bar Controller (New Referencing Outlet) to the Tab Bar App Delegate 5) Make a connection from the Outlets (In the Tab Bar Delegate connections) to the physical on screen items 6) For each on screen item, make sure it's Outlet delegate is the Tab Bar delegate.
That should be it.
|
|