iPhone Coding WTF
I was asked to code some enhancements to existing iPhone app. I was told it suffered from a lot of bugs leading to crashes and even twice rejection by App Store review team. I was preparing for, quoting last words of Kurtz: "The horror! The horror!".
Unfortunately it came true. Obvious truth has been proved once more: you may know the programming language, and even API, but software design is left behind. Main app controller class was almost 3000 lines long, and below you can find one of my favorite pieces.
The morale is short and simple: stop thinking in Turbo Pascal. Objective-C, as name suggests is object-oriented language, so for God's sake, use it!
Masterpiece example is to be seen below...
Apparently sky is not going to fall down. Apple and Oracle just announced teaming on bringing Apple's modifications to OpenJDK project. It will be even better than now, as we will get fresh Java 7 from Oracle just on time. This is not obvious as usually vendors provide Java on their own (IBM does so, and HP too). Oracle is taking care of Solaris version because it is their own playground, Windows version because of Microsoft's license revoked and finally Linux because there is no one that will do that. And it looks like Apple was able to convince Oracle to take responsibility of delivering Java for Mac OS X.
via Apple's PR
Yes, it is possible to create XIB-based view controller in application written using Three20. The trick is quite simple. Suppose your controller class name is FirstViewController. All you need is just create XIB, and override loadView method:
- (void)loadView { [[NSBundle mainBundle] loadNibNamed:@"FirstViewController" owner:self options:nil]; }
loadNibNamed method deserializes content of XIB file of given name, and sets the owner to controller itself.
Three20 is definitely great framework, and I find it a good starting point for applications having more than a few views. It has some quirks however, and one of them is that it makes almost no use of nibs, which is especially annoying in case of custom table view cells. It was claimed that constructing cells in code is faster, but that gain may be not worth the effort. So let's stay in 21st century and design cells in Interface Builder. In addition, let's use Three20, because it is great framework.
Another reason to give up Flash
According to MPEG LA, H.264 is available royalty free for anyone providing content for free. This will not make Adobe happy, as there is yet another reason to give up Flash support on mobile devices in favor of HTML5.
Well... my debut in App Store was relatively painless, contrary to horror stories one can read on the web. Eventually I received an email saying that my depth of field calculator (photographers know why it is useful) is ready to sale in App Store, named Phocus!. I consider it rather a warm-up and opportunity to get familiar with App Store process, which happens to be unintuitve sometimes. If you happen to do some photography, go ahead and help me become millionaire
Visit official Phocus! app page.
Simple iPhone FPP 3D engine
This will definitely not be a competitor for commercial 3D engines like Unity, however I decided to code simple 3D raycasting engine just for fun. I don't see sense making exact copy of desktop-class engine to such small device like iPhone, so it may be a nice starting point towards something interesting.
This proof of concept has been developed using Cocos2D engine, which is based on OpenGL and actually allows to display 3D content, but with some additional effort needed. I'll try to cover it sometime soon.

iPhone raycasting engine
The obvious, and most widely suggested method of changing default HTTP port that Grails app listens on, is to add command line switch:
tomek@jabuszko:~$ grails run-app -Dgrails.server.port.http=9900
Personally, I don't like this. Command line became a bit lengthy. Creating extra run configuration in Eclipse. Not for lazy hacker like me. It's much simpler to edit grails-app/conf/BuildConfig.groovy, add
grails.server.port.http = 9900
and voila!
Very crash course on Mercurial
Even in small, homebrew projects driven by only one individual, version control system is very welcome. You have vide variety of options to choose from, but in my research i limited myself to ones I know, or at least heard good opinion.
Posługiwanie się iPhonem
Instrukcje obsługi czytać nie tylko należy, ale i warto. Wydrukowana drobnym maczkiem książeczka "Ważne informacje o produkcie", przedstawia katalog czynności, które są zabronione:
"Nie należy rzucać, rozbierać, otwierać, zgniatać, zginać, deformować, nakłuwać, skrobać, wkładać do kuchenki mikrofalowej, palić, malować, wkładać ciał obcych do wnętrzna iPhone'a"
Sposób sformułowania sugeruje że katalog jest zamknięty, więc od mojej kreatywności zależy co mogę zrobić z telefonem. Nie jest zabronione ubieranie (ale rozbieranie już tak - lepiej się zastanowić), lizanie, ani wkładanie do kuchenki gazowej (ja mam elektryczną z termoobirgiem).
Apple służy również dobrą radą kierowcom samochodów: gdy w trasie zadzwoni Twój iPhone, "poinformuj osobę, z którą rozmawiasz, że prowadzisz". Gdy już poinformujesz, możecie się zastanowić czy warto rozmawiać. Ale Apple ostrzega, że "prowadzenie w deszczu, deszczu ze śniegiem, przy oblodzeniu, we mgle i dużym ruchu może być niebezpieczne". Gdy jednak koniecznie musisz pogadać, zalecana jest asertywność: "nie angażuj się w stresujące lub nerwowe rozmowy, które mogą odwracać uwagę".
Z poważniejszych ciekawostek warto zwrócić uwagę, że we Francji i we Włoszech iPhone jest przeznaczony tylko do użytku wewnątrz pomieszczeń.
Również budząca emocje kwestia zmiany kolorów czujników wilgoci jest niejako wyjaśniona przez zakaz używania iPhone'a w deszczu, w pobliżu zbiorników wodnych ani w innych wilgotnych miejscach. A dopuszczalne temperatury pracy mieszczą się w zakresie 0-35 stopni, co zimą wymusza odpowiednio warstwowe ubieranie się: trzymając telefon w zewnętrznej kieszeni możemy narazić go na mróz, z kolei zbyt blisko ciała możemy osiągnąć temperaturę 37 stopni (zatem nie wolno chorować!), że nie wspomnę o nadmiernej wilgoci na skutek pocenia się (nie biegać na autobus, jechać następnym!).
Wszystko wskazuje na to, że życie z iPhonem może być uciążliwe, ale ostatecznie wyjdzie nam na zdrowie.

Polski
English




