Friday, August 22, 2008

Toying around ...

I purchased on the App Store the game Toy Bot Diaries from local company (Vancouver!) IUGO, after reading the review posted on touchArcade. I can only agree with the author, it's a very sweet deal (nice gaming, low price). Best of all, the game take advantage of the controls native to the platform, and it work out pretty well, except if you are trying to play while lying down ... In this setup, I found the control to not work too well. No big deal really, I shouldn't be playing right before sleeping anyway ... ;-)

Meanwhile, I have been continuing my Cocoa musing without Interface Builder, and banging my head on the (one will think) simple issue of filling the application menu. Hopefully for ma sanity, I came accross Jeff Johnson's blog which have a serie of great posts (and a sample XCode project), on how to create a Nibless application. Turns out it's not as simple as it should be. It's also more akin to hacking the framework than using it ... anyhow it does work.

Before I sign-out, I will like to point to a video from the lastest iPhoneDevCamp, which feature Neil Young's (no, not the singer) keynote on the iPhone as a gaming platform.

Wednesday, August 20, 2008

Blast them again!

I just realized that I forgot to talk about the opening of the Clone Wars. Like any other geek watching the show, I was expecting the standard opening of a Star Wars movies with John Williams music and scrolling text ... So I was surprised and somehow deeply disturbed to see the opening not conforming to the canon. In fact, it reminded me a lot of the TV news broadcast in the opening of Starship Troopers ...

Blast them!

So I went to see the Clone Wars animation last night with an old friend, and I don't know why the "critics" are so harsh about it, 'cause we both enjoyed ourselves (along with the other 10 adults and 25 younglings present). Of course, it probably have to do with the fact that combined we have the mental age of a 12 years old, but still .... it was a fun 90 minutes, filled with lots of action and ... yes, a simple story line. I think it is clear, that the movie was targeted to an audience much younger than the usual Star Wars crowds. As for the CG and animations? Well, it's definitely no Pixar movie, but I do think it was alright even if at time the characters motions were a little stiff.

Speaking of animation movie, I noticed something interesting on the Bagelturf blog, a link to an animation created by a group of student of the French art school Gobelins. Oktapodi is not only funny (in a Pixar shorts sort of way) but also well done, check it out on YouTube:


Tuesday, August 19, 2008

2.0.2

Apple blessed us, iPhone and iPod touch owners, yesterday, with a new update. The release note is as usual a trove of details: "Bug fixes" 9_9 ... I seriously don't understand why they can put a bit more details so that people can have an idea of what got fixed or not. We all know, heck, the all world know that 2.0 OS was a very buggy release. Issues have been discussed all over the web! But I guess very few (if any) were acknowledged by Apple. The usual obscurantism at its best.

Once the placebo effect recessive in a couple of days, I'll be able to take note if downloading around 250Mb (!!?) was worth it. But right now, the UI seems a little snappier than it was. However, I haven't noticed any improvement during application launches :-|

Saturday, August 16, 2008

NSApplication and delegate #2

The only reason for that yucky thing I could think off, is that they wanted to save people from having to define and implement all 14 methods each time a NSApplication delegate was needed, even if only one of them was needed. Since the concept of optional method in a Protocol was only introduced recently in Objective-C 2.0, using a protocol for the NSApplicationDelegate (or for NSApplicationNotifications) was I guess not a solution back when NeXTSTEP was been designed and implemented. Still, having to define and implements a bunch of methods isn't much of a huge burden (copy&paste), likely only a couple of them are going to have a real implementation, and the number of application delegate class per application is mainly, well ... one.

I'm aware that adding methods in Objective-C isn't as costly as adding a virtual method to a C++ class, but still ... this is not a very elegant solution. As this thing used all over the place? I'm a little scare to find out ...

BTW, sorry for the sloppy code formatting on my previous posts. I still haven't figured a nice way to present it with proper indentation. Syntax highlighting will be nice too.

Friday, August 15, 2008

NSApplication and delegate

Last night, I finally restarted my Cocoa learning effort, by looking at how I could write an application without using Interface Builder. IB is so vastly used that there isn't as much details available on the web on how to go about with it, nevertheless, there is enough to get started. And in fact, it is relatively easy, at first.

A Cocoa application, in its simplest expression, is composed of a single NSApplication object and one (or more) NSWindow object(s). Overall, it doesn't take much boiler code to get something going, which is good:
int main(int argc, char *argv[])
{
NSWindow *lWindow;
// create an auto-release pool
NSAutoreleasePool *lPool = [[NSAutoreleasePool alloc] init];

// initializes the display environment and connects to the window server
// and display server
[NSApplication sharedApplication];

// create a window
lWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(10,10,320,240)
styleMask:kStyle
backing:NSBackingStoreBuffered
defer:NO];
// set the window's title
[lWindow setTitle:@"Hello world!"];
// show the window and move it foreground
[lWindow makeKeyAndOrderFront:nil];

// start the application run loop
[NSApp run];

// release the window
[lWindow release];

// release the pool
[lPool release];
}

The Application object gets a bunch of notification from the system during its life-time. If I wanted to perform some actions in some of them, there is two ways of doing it: I could subclass NSApplication and implement the corresponding methods, which is the usual way of doing it in 99% of the toolkits out there ... or, I could follow the Cocoa way and use a delegate instead. Since the later is what Apple encourage developers to do, the NSApplication class is built to support the addition of a delegate by sending it a setDelegate message.

Now, as expected, this message take as single argument: the object to be the delegate. So far so good. However, instead of defining the argument with a specific class, for example something like said NSApplicationDelegate, it is defined as an id (meaning any kind of object). Since I'm still more of a C++ kind of guy than an Objective-C dude, I found myself a little puzzled by this but still decide to move forward by searching in NSApplication.h (since I didn't see anything in the class documentation) for the delegate class I am expecting to have to subclass, or some sort of protocol definition.

In the header file, I was nicely surprised to see that NSApplicationDelegate does exists, but in a way I was not expecting, at all: @interface NSObject(NSApplicationDelegate). Yep, that's right. A category ... meaning that any object with NSObject for root parent, can be the application delegate ... Since 99% of all Cocoa's classes have NSObject as root, any objects can be the delegate .... including widgets! If this isn't yucky, I don't know what is! Why on earth didn't they use a protocol!??

Wednesday, August 13, 2008

I want(ed) to believe!

No really, I want to believe so much the up-coming Clone Wars movie isn't going to sucks that I'm ready to like, totaly, forgot about the review published then retracted by Ain't It Cool News. Also, I won't even think about, nor mention the low 44% on the Tomatometer, given by the Rotten Tomatoes self proclamed critics. I found their lack of faith, disturbing. Instead, I'm going to be watching over and over the trailers, and the videos available on the movie site. Since I already watched (by-myself mostly) Episode 1 & 2 this past Sunday afternoon, my Star Wars geek-o-meter readings are off the chart! I can almost feel the force ... can you?

Sunday, August 10, 2008

2.0.1

So I upgraded my iPod touch yesterday morning from 1.1.4 to 2.0.1 ... Since I had a jailbroken unit, I was a bit worry that I may encounter some issues, but the whole process went pretty smoothly. All I had to do was to hit the restore button in iTunes, which installed 1.1.5 and whipped all the apps and data I had installed (no big deal). Once that was done, I bought the 2.0 update from iTunes and that was it.

2.0 OS has been discussed a lot since it came out, so I'm not going to get into any details, I'll just said that, yes the unit does feel more sluggish than 1.1, and yes there's a lot of so-so apps on the App Store. I wishs there was a way to download demo version of some of the game. For example, I bought Crash Bandicoot Nitro Kart 3D, and I regret it 'cause I don't like it that much (there goes 10 bucks ...). Some of the apps, are very familiar to me, since they have been available on jailbroken devices for months, such as Vladimir Kofman's Converter ($1). It's a cool app, which doesn't seems to have changed a lot ... except that now it's much slower to start than before :-\ Hopefully Apple can fix that up in the up-coming 2.1 update .... 9_9

Bottom line, was it worth upgrading? Not really.

Wednesday, August 6, 2008

Blown away ...

We had a long time friend over last night for diner and I had the "bad" idea to introduce him to the iPod touch. Now, he had heard about the iPhone and iTouch before, but never had the privilege to play with one ... and he was literally blown away by it, especially by the touch UI experience and easy of web browsing ... and also by the few games I had on it (still running jailbroken 1.1.14) making use of the on board accelerometers. I had to use all of my persuasion skills (which isn't much really) to restrain him from running to buy one right away ... with a rumored update right around the corner, it is definitly worth waiting a month or so.

This past Saturday, I was my self impressed by the latest iteration of Grand Theft Auto on a friend PS3. I had heard of it before, obviously, but never actually played it .... let's hope an iPhone version (or clone) shows up on the app store ... 'cause it's a pretty darn cool game. Granted it's dark and violent, but it's a fun game nevertheless ... now if only I could manage to drive around without hitting pedestrians and other cars ... 9_9