Wednesday, July 1, 2009

Rachel Brinkman - Week 4 - 7/1/09

1. What was planned?
- Learn about the capabilities of the iPhone accelerometer and build a limited prototype of the table tilt game (by this Friday)

2. What was done?
- Worked on table tilt prototype - got the app working in landscape mode, found an alternate way to draw using the CoreGraphics framework, and got simple ball physics working on one iPhone.

3. Problems encountered?
- Making a multiple-view application in landscape mode is actually not possible. There is a key that can be set in the Info.plist for the project that is supposed to force the orientation to whatever you choose, but it does not seem to have an affect unless each view controller also gets instructions. Even then, only the primary view will change, and not the secondary view. After searching around for a while, I discovered that landscape mode for multiple views and view controllers is not actually possible. Applications that appear to be this way are actually just faked - one or more of the screens is just an image that makes the user think that the screen has rotated. This is different than in-app rotation by the way - it is very possible to take a portrait app and rotate to landscape when the user turns the iPhone. However, this was not what I needed. I ended up creating a landscape splashscreen view and a portrait game view, but the user will assume that it is still in landscape, and so they will still hold it that way.

- Another problem that I had was with drawing, although the fact that the device was not drawing was actually indicative of a larger problem. Basically, the flow of control for the program had entirely disappeared, and the timer that I had created within the main thread of execution was never being called. I discovered that when using .nib files (so basically any time you are using multiple views), all of the objects are archived inside the .nib, and so the initWithFrame method is never called. This method contained all of my timer initialization code, and since it never ran, nothing was happening in the program. The fix for this is to use the awakeFromNib or initWithCoder methods instead.

- DEPLOYMENT. Deploying to an actual device was a nightmare - Apple has a lot of different certificates that you need as a developer before you can deploy your app, and even when you have created all of them, there are lots of little things that can go wrong along the way. Thanks to Evie and Thomas for helping me get that working!

- The accelerometer is also a problem right now. I can access the data from the three axis correctly, but am running into trouble with the math that ties the readings to the physical movement of the ball.

4. What did you learn this week? (esp. computer science, or anything surprising or interesting)
- Learned a lot more about views and .nib files
- Learned an alternative way to draw on the iPhone
- Learned some about the accelerometer on the iPhone
- Learned more about Objective C

5. What's planned for next week?
- Finish the prototype by this Friday
- Go to the AIED conference!

6. Hours worked.
40

No comments:

Post a Comment