A great Video Tutorial series on YouTube from My Bring Back demonstrating how basic Objective C code works.
The first 5 videos show how to assign variable integers and floats and also demonstrate how to round these variables when outputted to the NSLog.
Example code from Tutorial 5
int main(int argc, const char * argv)
float x = 4.52343;
int y = 2.89345;
float sum = x + y;
NSLog(@"%.f + %i equals %.2f", x, y, sum);
The ‘%f’ indicates that a float will be substituted into the outputted string, a single period ‘.’ will round the float to the nearest whole number and a ‘.2′ will round the float to 1 decimal places.
Also note that the substituted pointers are ‘%f’ for a float, ‘%i’ for an integer.
January 20, 2012
MySQL has been my database solution of choice for over 5 years now, it’s solid, reliable, easy to use/setup and you can transfer data between databases in a quick, but I was tired of always revising my database schema for every iteration of site that I built. I thus started researching schema-less databases and found only two, real, candidates that would integrate nicely with php, couchdb and mongodb. I tried couchdb but found the query language/Erlang combination to be a bit difficult to get on with on a daily basis. This left me with mongodb.
Firstly I had to install the PECL extension for php, a fairly straight forward task.
Next I simple ssh’d into my VM and apt’d the package mongodb-10gen.
Restarted apache and I was ready.
To help you get started querying straight away the mongodb site provide a very hand sql-to-nosql userguide.
January 10, 2012
So I learn’t today that once you revert an iPhone 3g to factory default and try to install Bejewelled Blitz (which you had previously installed) it won’t, as iOS needs the latest video drivers to work! Rather annoying!
Just a quickie, I recently swapped the standard hard drive in my MacBook for an SSD drive – all I can say is WOW! my MacBook must be nearly 5 years old now and it runs like a new machine. In fact it runs better than some of the latest iMac’s
I cannot recommend this swap enough, if you are a developer like me who does not want to fork out £2k for a new MacBook Pro!