Monday, October 25, 2010

Into The Blue (SD) Re-Released


After a few weeks of being offline, our game Into The Blue is now back in the AppStore!
We recently moved from a company to a common developer account. Unfortunately in this situation apple's system doesn't support moving applications across just yet. That's why we had to pull Into The Blue from the store and resubmit it using the new account.

SD vs. HD
Why is it named SD now? Simply because we weren't able to submit the game with the same name since the old version is appearently still in apple's system. Also chances are good that after we have finished working on our current project Gem Hunt (will blog about it soon) we'll find time for an HD version for Into The Blue.

While we had to resubmit anyway, we now added PlayHaven support to it and updated OpenFeint. We'll be also looking into releasing the LITE version soon with the new account.

Wednesday, October 13, 2010

Latest Proceedings: JSPortal.app, gh-unit and drilldown UIPickerView

Todays post is a about where i'm at with my current iPhone project and what i've been up to tech-wise.

My current project: JSPortal(.app)
I'm currently working on an iPhone App for a friend's WebApp called JSPortal.
I don't want to go into too much detail in this post but let me at least tell you that it is a quite cool time- and budget tracking software. It's also free of charge for up to 3 users. If you are looking for something to keep track of your development projects you should check it out.
Joost did a great job in providing a demo mode that let's you demo the WebApp right away. No signup, no email verification. Peace of mind.
The first version of the iPhone App is going to help JSPortal's users assigning work time to projects.
Since last week i made a lot of progress and hope i can finish it in time. This would be the 29th of October. Let's see if i can make it.


Unit Testing with gh-unit
Back in my Java days i wrote a lot of automated unit tests with JUnit. Since i started making my first iPhone game i've become a bit somewhat slack and didn't do much testing. Last week i finally started looking into testing again. At first i looked into OCUnit which i understand is shipped with XCode. It runs the tests during the build and you can see the results in the build view. I see that running them together with the build has its advantages. Such as having your build simply fail when there are tests not running. But here's the thing, i'm a very graphics oriented person and i only want to look into my tests when i'm running them. I want to see green and red bars. That's it. The gh-unit project runs its tests seperately from the build. The iPhone version of gh-unit runs the tests within an own iPhone AppDelegate which gives you also the opportunity to test aspects of your view as well. The only issue is that it also misses my beloved green and red bars. So i went a head and forked the gh-unit project and implemented them.
I feel that the table-view with these rather big bars and labels works well for a limited number of tests. For bigger projects smaller rows might be better. I can also see a custom view with lots of little squares for each test-method. That way you might not see which method in detail failed but you'll have a better overview over which suites/classes passed.


Drilldown UIPickerView Component
I still consider myself more of a freshman in the UIKit area but i also feel like my understanding is growing a bit every day i work with it. Today i was able to create a UIPickerView component that supports nested elements. It has some really hacky bits in it (the code, not the view) but it works well. It is also reusable because it gets its row items from a delegate. If someone is interested in the sourcecode, let me know.

Friday, October 8, 2010

Getting better at XCode

Yesterday i felt it was time to revisit the way i use XCode (3.2.4) and see if i can find some useful functionality that i can use more often. I also had a look at shortcuts and either created some that were missing or changed the ones that are hard to remember or simply hard to use for my taste.
Update: added sections Warnings, Split-Screen Editing, -(id) init {... and Recommended Reading [10/14/10]

File > Open Quickly... ⇧⌘D
This is probably the coolest feature i just haven't used yet. Instead of looking in the sidebar for your file and eventually clicking it, Open Quickly... opens up a little dialog window and shows matching files or methods as you type. I also realized that it captures your currently selected text.


Edit > Refactor...
[1]






I used the Refactor > Rename functionality occasionally but always had the impression that i'm waiting longer for it to finish as i would need changing the names by hand. But if you uncheck the Snapshot option it's actually quite fast so there's no excuse not to use it. I'm also going to use at least the option Extract from now on to extract lines of code to a new method if it makes sense.
Note: Please uncheck the Snapshot option at your own risk.

Edit > Completion List [2]
I probably never used this function a lot because my fingers aren't used to use any shortcuts containing Escape. I always used Next Completion instead but sometimes you aren't even sure about the first letter the function you need starts with so that's where Completion List is for.

Edit > Format > Re-Indent [3]
I realized that i'm re-indenting a lot by hand by throwing tabs and spaces at lines. This is stupid. Re-Indent can be used on a selection or on the current line. It also seems that ^I triggers Indent-Line.

Build > Clean ⇧⌘K
I actually never used this before... ok just kidding - but i always used the mouse to do this. The shortcut isn't that hard so i'll try to use that from now on.

Build > Build and Analyze ⇧⌘A

This is a somewhat useful thing to check on your alloc-fu. The clang analyzer will go through your code and will notice for instance that you don't release that object you created without autorelease.
There's also a target setting called "Run Static Analyzer" to run analyze automatically. Although it's a great way to keep writing alloc-sane code it slows down build time which is why i turned it off again.
Note: as suggested here i had to add -D__IPHONE_OS_VERSION_MIN_REQUIRED=040100
to Other-C-Flags in my project settings so that the analyzer works with my current XCode settings. Might be a specific problem related to 3.2.4.


Help > Quickhelp [4]
Wow i really feel stupid not to have used this function before. For example if you select a method name and execute Quickhelp it will show you a little help window with some documentation if available.

iPhone Simulator Window Scale Shortcuts
To change the iPhone Simulator's window size it seems you have to do it with the mouse curson in the menubar since there's no shortcut for it. I had a look at the XCode shortcuts but didn't find any setting for this.
So my solution was to create a shortcut under System Preferences > Keyboard.
Simply add an Application Shortcut for 50% and 100% and you are done.


Warnings
in the past weeks i noticed that i tend to care more about warnings. If you want to always see your warnings (they usually hide after you run the build a second time) just switch to the tab "All Results" in the "Build Results" Window.

Split-Screen Editing
Today i found out in the article mentioned below how to edit multiple files in one window.
There are two little icons on the right edge of the window above the scrollbar to add another window vertically or horizontally.

- (id) init { ...
If you are as lazy as i am and you didn't put a default init macro in your obj-c template file you can also insert a full init statement manually by using Edit > Insert Text Macro > Objective-C > init Definition. Shortcuts can be added via XCode Preferences.

Recommended Reading:
14 Essential Xcode Tips, Tricks and Resources for iPhone Devs by Dan Grigsby

[1] I assigned the shortcut ^R to it since i'm not going to use whatever ^R is usually doing.
[2] I assigned ^SPACE to it since that is close to the shortcut i know from eclipse.
[3] I assigned ⌥
⌘I for this.
[4] I didn't like the shortcut and now assigned ^H to it.