jump to navigation

Every character is important 23 June 2009

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

DAY 10, and a little bit of progress. I found one error, which was about to drive me mad, until I more or less by accident stumbled over the solution on stackoverflow.com; in answering a slightly different question, Rob Napier commented on a bug in the way NSLog() was used.
NSLog(@"Returning %@ rows", [nodes count]);
Here, the -count method returns an int, but the %@ symbol expects an object. Result: a bus error. You need to use %d instead. And here was I, thinking how great it is not to bother with the old printf format codes, using the %@ way instead. I hate the primitive type/object distinction!

I then also found that I had created two superimposed Table Views (did I mention that I don’t really like Interface Builder after all?), so that my table got overwritten and looked all wrong. Now I’m struggling with getting the table to start at the first entry, not the 35th (indexPath seems to start counting sections at 1, rather than 0), and all of a sudden my database won’t work.

Preparing a straightforward SQL statement suddenly fails. I did not change that part of the code, the database file is still the same as it used to be before the error occurred, and I did tell XCode to do a full clean. Still, the error remains.




1. Every character is important - 23 June 2009

[…] Original post by ojmason […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: