Wednesday, December 23, 2009

Adding Email in-app dialog to OpenGL App

I encountered a problem when trying to follow this tutorial about adding in-app Email dialog. I had a general problem. I didn't have a UIViewController. I only had MyEAGLView instance, a UIView

After reading this article about UIViewController, it clicked.

All I had to do was create a UIViewController in the appFinishedLoading and then I added the opengl view to the viewcontroller. Then made the view of the view controller as a subview of the window.


viewController = [[UIViewController alloc] init];
[viewController.view addSubview:glView];

[window addSubview:viewController.view];

Tuesday, December 22, 2009

iPhone Ad Hoc distribution

I am just going to paste some links that helped me out through the process of nailing down a release that I can give to my friends for beta testing. Just need to fix some bugs before giving them the beta :)

Process of setting up ad hoc build
http://developer.apple.com/iphone/manage/distribution/index.action

Tutorial to give to users to get the UDID
http://www.innerfence.com/howto/find-iphone-unique-device-identifier-udid

Tutorial to give to users for installing beta
http://www.innerfence.com/howto/install-iphone-application-ad-hoc-distribution
http://www.innerfence.com/howto/install-iphone-application-ad-hoc-distribution?zip_file=AppName.app.AdHoc.ipa

Debugging Crash Logs
http://developer.apple.com/tools/xcode/symbolizingcrashdumps.html

Tuesday, December 15, 2009

Xmas tree - gamedev analogy

Today I was assembling our new christmas tree, when I started comparing the process with developing a game.

When you start assembling the tree you first put in place the base, then the pillars where you will start hooking in the branches layer by layer.
Well, even in gamedev we have to make the skeleton, some basic engine where you can start building a prototype, feature by feature.

Then comes in the decorations, tinsel, lights and the star at the top of the tree. Even in gamedev you have polishing, polishing, polishing, and even more... you guessed it... POLISHING! It's those small details that make a christmas tree look great. That also counts for games (anything really)

Best wishes to all.

Monday, November 23, 2009

Localization/Internationalization/i18n for iPhone apps

I have found this internationalization guide on how to make your iPhone app behave appropriately according to the iPhone's language preference. Very easy to get started. Ideally the strings are externalized as from day 1. It's a bit time consuming externalizing them later on :(

Friday, November 20, 2009

High Score System in place

I'm still working on the iphone game, but only a couple of hours a week unfortunately. I have created a High Score system using Rails on Heroku.com. Heroku is a very nice Rails hosting service - which is also free for a basic setup and easily be ramped up in a jiffy.

The next think I need to check is the in-app purchases for downloadable content. Should be interesting...

Sunday, October 25, 2009

Updating the Provisioning Profile

When my provisioning profile expired, I had to create another one. But I had problems hooking it with the project. This how-to saved the day.

Tuesday, September 29, 2009

Unit testing on the iPhone SDK

I have been busy preparing lectures (still am) but I'm still alive :)

Introduction

I realised that I was adding code to the iPhone project more like in a prototyping stage. I wasn't doing any tests but I still tried to organize the classes as best as I could. Now I'm starting to loose confidence when I'm going to add some features. Not a good feeling. I want to switch to TDD (Test Driven Development), where you first write a failing test, and then write the production code. The excellent side effect of this is that the design of the classes are automatically decoupled. However I need to first convert my project to be covered by tests. Found an interesting book called "Working Effectively with Legacy Code" where it gives a lot of tips on how to breakdown classes, etc. I'm still reading it in my free time, but I will soon be putting the tips to work.

Setting up test harness
I searched for setting up a test harness in XCode. Version 3 supports unit tests using the SenTesting classes. I found a presentation and an Apple support page to set up a test harness. It also describes for setting up functional testing, however I will be only using unit (logic) tests for now.

Some tips to finalize the setup

Remember to drag any .m files into the Compile Sources in the logic tests target and also any libraries.
Also edit the Active target LogicTests and under Build tab, in Gcc 4.2 - Language section, turn on Precompile Prefix Header and also set the Prefix Header to _Prefix.pch
It is very important to this as otherwise it will give you loads of errors like could not find CGPoint class, etc

NSLog...where are they output?
What about logging when running the tests? Since to execute the unit tests you just need to build the application, there is not console out from XCode, however you can view the output of NSLog statements in the Console application. Launch Console from Spotlight.

Code Coverage
I also wanted to have code coverage, to know how much of the code is being tests by the tests. I found an excellent tutorial on setting up code coverage. It uses CoverStory - a tool for viewing the results of code coverage.

Now I need to rewire my brain to think in tests...