jump to navigation

Table Frustration 31 May 2009

Posted by Oliver Mason in Apple, iphone, objective-c, programming.
add a comment

DAY 8 and after a long pause I have been able to spend a bit more time on my project. And it was certainly frustrating, racking up the hours while trying to work out why it didn’t work. One thing I need to get used to are IDEs; more than a decade of simply editing code in vi and compiling it on the command-line leave you ill-prepared for working with XCode, nice though it may be. Interface Builder is also a great tool, but it hides things from direct view or easy inspection, at least if you don’t know where to look. And then something doesn’t work because you omitted a link from a View to its File Owner, or you set the base class of MainWindow.xib to a wrong class type.

After trying out some table code in the iPhone Development book I finally got a small demo going. I’m now trying to create an indexed grouped table display backed by a sqlite database working. But now it’s approaching midnight and I’m too tired to work out why it stopped working again…

However, despite all of today’s frustration, I’m getting more and more used to coding in Objective-C, which has to be a positive side-effect!

Further Education 11 May 2009

Posted by Oliver Mason in iphone, objective-c, programming.
1 comment so far

I’m too busy with marking and a paper I have to write to get stuck in again. On the way home today I had a thought about the database-backed table view it will include: something regarding sorting which I came across when working at the Cobuild project. More on that later.

But I’m still using the time more or less productively by watching the lectures on iPhone programming from Stanford (available on iTunesU). Not too sure about the performance aspect, but it is great to be able to listen to those guys explaining the intricacies of Objective-C memory management. And I won’t complain, as it is freely available. Thanks for that, Stanford!

Building the database without glare 5 May 2009

Posted by Oliver Mason in Apple, erlang, iphone, objective-c, programming.
1 comment so far

DAY 7 sounds like a lot, but again I’m only working a few hours in the evening after the kids have gone to bed. I have the feeling that there is a lot of ‘boilerplate’ code to write in Objective-C, or Cocoa at least. But then, that might be the problem with GUI-related programming. Erlang doesn’t nearly need as many lines to accomplish something, anything really! But then, the kind of Erlang programs I’ve been working on are basic R&D text-only affairs, not MVC-style user interface programming.

I have today learned how to turn off the iPhone program icon glare (add UIPrerenderIcon=true to info.plist in the bundle), which I think looks better on my icon which had a horizontal line just about where the glare-line was. I also created a SQLite database from a text file. Next I will need to integrate the DB with the table view, for the first part of actual functionality. I keep switching between chapters in the textbook, the one which builds tables and the one which deals with persistent storage. Why did nobody think of doing a database-backed table view? Need to check Apple’s sample code, they’ve got a book-storage one which might do that.

The depressing bit is that I write a little Noddy-program, and it takes me ages. Mainly getting used to Cocoa, Xcode, and Objective-C, but also going back to no garbage collection, and shifting data between classes I know not well at all (NSString, NSArray, etc). I think my niche will be little utilities, rather than glorious games!

Certified 5 May 2009

Posted by Oliver Mason in Apple, iphone, programming.
1 comment so far

DAY 6 was a little frustrating, but ended on a positive note. First I was struggling with Xcode and multiple views, and strange errors. I had my iPhone plugged in to charge, and that made Xcode stop, complaining about the mismatch of a certificate or something. I then went to Apple’s site to activate my developer’s programme membership, and after some messing about with certificates and provisions it finall worked. And, instead of running the emulator, Xcode installed the app on my phone. It’s only a skeleton at the moment, but it is really exciting to see the first bit of software that I wrote myself running on the iPhone itself!

I then re-did the icon, using a darker colour, as the phone put in a highlight by itself, and it looks better that way. I need to do more icons now, as my tab-bar is text only at present. And then I need to code the actual program!