home

Cocoa Programming: My First Steps

Recently I have been learning the programming language Objective-C with the view to creating native Mac OS X programs. I bought the book “Cocoa Programming for Mac OS X” which was a brilliant read and had excellent examples to work through – I’d certainly recommend it to anyone thinking about learning about Cocoa.

I found it hard to get into the mindset of programming using objects (which are all pointers) rather than the usual C/C++ way where you work primarily with data types. But it’s all started to fall into place and I think I have got to grips with it now.

My next step is to create a program which is actually useful! Not sure what I’ll create yet, so keep an eye out!

First iPhone App: IPCalc

[Please see my new iPhone apps page]

Last week I decided to give iPhone programming a try after having download the iPhone SDK a while back. I started to get frustrated with Objective-C because it’s quite a lot different to my old friend, C++ and so I had problems getting into it. In order to learn, I decided to set a challenge of creating an IP calculator program (something which there are only non-free ones of in the App Store).

I managed to get quite far with the programming and had the software displaying a reasonable GUI which seemed to be pretty good, but I was struggling to work out where to put code and exactly what I should be doing about calling functions on objects (quite different in Objective-C compared to C/C++). Feeling a bit depressed by not being able to understand the code I decided to buy Cocoa Programming for Mac OS X which had very good reviews.

The book arrived today, and I read a few chapters and managed to actually finish the first version of my software! Woo! So, I am now an iPhone application developer… apparently… Hopefully I’ll keep creating better things and improving on this very crude first version.

(Unfortunately I can’t test on my iPod Touch yet as I don’t have a license to install on real devices – it costs $99!)

MacBook wireless dropout (POSSIBLE FIX)

Ever since I upgraded to the latest Leopard release the other week, my MacBook has had random wireless dropouts. It’s been an intermittent issue and has only affected my MacBook and not the iBook (PowerPC) or Mac Mini (Intel) in the house.

I’d been trying various things to get it fixed like changing the security settings on the wireless router, but the only thing which seemed to fix it was changing the “Group Key Renewal” to 600 on my router (LinkSys WRT54GS).

So far, so good… just a little tip incase anyone else is having the same issue!

EDIT: It’s definitely fixed – I’ve had no dropouts of my MacBook since changing the group key renewal from 3600 to 600. I’m not sure why this was a problem before, but hey, it works. Maybe the wireless card on my MacBook is a bit crazy and doesn’t like being renewed every hour rather than every 10 minutes. Strange…

Time Machine: I'm backing up, eventually!

I’ve been meaning to get a proper backup system going for a while now and I’ve finally done so with Leopard’s built in “Time Machine” feature. The one thing I hate about thinking about backups is that you don’t want to test your method thoroughly, as that would require you to simulate a catastrophy (i.e. throwing your computer at a wall, or such like) and so it’s very hard to know what’s going to work. This is why I opted for a backup solution which has been written (and presumably tested) by a major IT expert – in this case Apple. I trust Apple a lot – their software is usually flawless and their hardware even more so. And when there are problems, they fix them quickly (e.g. MobileMe problems).

After upgrading my MacBook hard drive, my overflow external drive was spare and so I’ve commissioned it into being a dedicated Time Machine backup drive. Currently it’s whirring away doing the initial backup (some 145.8GB of data…) and when that’s done it will do incremental backups every time I plug the drive in and click “Backup Now”.

I’ve never had to restore anything from backups, ever (*touches wood*), and I’m hoping I never will. But having a good backup plan is critical to modern day life because we hold so much information on our drives. I’d hate to lose all my data, it would really be so annoying.

So once this initial backup is complete, I’ll be a backed up man, ready to roll.

Upgrading a MacBook Hard Drive

Today I embarked upon upgrading the hard drive in my MacBook because it shipped with 80gb (upgraded at the time from 60gb!) and it was becoming fuller and fuller. I had already moved my iTunes and iPhoto libraries over to an external USB drive because of lack of space, so I thought it would be time to upgrade the drive, seeing that MacBooks are supposed to have user serviceable RAM and hard drives.

Read the rest of this entry »

SuperDuper: Mac Backup Software

During the process of upgrading my MacBook hard drive I needed some software to copy my original drive over to my new hard drive. This is no easy task because the new drive needs to be bootable and if possible, a complete replica of my original drive (otherwise it would take hours if not days to restore my system to how I like it).

So in came SuperDuper which is a nifty piece of software which will do just what I wanted. It’s free for the trial version which will let you do most things (no time limit) but if you pay $27.95 then you can unlock the extra features like incremental backups. This might be something I’ll look into soon as I do need a decent backup system (I’m going to look at Time Machine first).

It really was so easy to use SuperDuper though – copying from my original drive to my new drive took about 2.5 hours for 60gb of data – not bad considering it’s doing a thorough job of making sure all metadata is intact (something which just copy and paste definitely wouldn’t achieve). Also, SuperDuper is fully Leopard compatible which is definitely nice to hear.

I’d certainly recommend the use of SuperDuper to anyone :-) .

Blogging whilst breakfasting

So today I’m in Stafford because Helen has an assessment day for the police which is being held at Stafford University. I dropped her off there about 30 minutes ago and then decided to pop into the town centre to see what’s around. It was 8:30 so all the shops were pretty much shut apart from the coffee shops, some discount shops and McDonalds. I was quite hungry and really needed a coffee so I thought I’d grab a McDonalds breakfast!

Anyway, whilst ordering I noticed a sign saying free WiFi, so I got my laptop out and here I am, on free WiFi in McDonalds! It reminds me of Canada where there was free WiFI EVERYWHERE – and I do mean everywhere. It’s a good sign of things to come in the UK.

So this is the first time I’ve ever written a blog post whilst eating a fast-food breakfast! Needless to say, the breakfast certainly hit the spot!

Breakfast in McDonalds

Mac OS X Virtual Hosts on Leopard

I’ve been doing some work recently on a couple of websites (one being for Riverdale) and in order to test the sites I set up virtual hosting on the copy of Apache which came with Leopard. There’s a few tweaks/issues with Leopard’s Apache which I thought I’d write down incase it helps anyone else, or helps me in the future when I forget what I did!

So to setup the virtual hosting you need to first change some details in /private/etc/apache2/httpd.conf. You should make sure that the line for the virtual host module is not commented out:
LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so

Then, at the bottom of the file, add in the following:
Include /Users/username/Sites/vhost.d/*.conf
Where username is your own username.

Then you should create the directory /Users/username/Sites/vhost.d and into it, put these two files:
00_default.conf:
NameVirtualHost *:80
<VirtualHost *:80>
   DocumentRoot /Users/username/Sites/
</VirtualHost>

01_virtualsite.conf:
<VirtualHost *:80>
   ServerName virtualhost1
   DocumentRoot /Users/username/Sites/virtualhost1/
   <Directory "/Users/username/Sites/virtualhost1">
      Options +ExecCGI +Includes +FollowSymLinks
      AllowOverride All
   </Directory>
</VirtualHost>

Again, where username is your username.

Then, in /private/etc/hosts you need to add:
127.0.0.1 virtualhost1

Restart apache and check out http://virtualhost1/ – it should work!

The big problem with Leopard is that you can ONLY share websites from your ~/Sites directory. It works though if you put a symlink in there to another directory (such as in ~/Documents), but keeping your vhost pointing to the directory in ~/Sites.

MacBook Fixed!

A couple of days ago I took my MacBook in to be fixed as it had a crack on the front case where the lid closes on the case. They took it in and said they’d order the part in and that it would take 24 hours. I picked it up, 24 hours later and it looked like a good fix. But when I got it home I noticed that they’d put on a US keyboard!!!

So I took it back in today and they managed to find a UK keyboard (already assigned to someone else, hehe) and they took just 30 minutes to fit it and now I’m sitting here typing on my brand new UNITED KINGDOM keyboard!

Google Apps for galloway.me.uk

Since the release of MobileMe by Apple, I’ve been wondering about what I’m going to do with my galloway.me.uk domain now that there’s options like this out there. I looked into MobileMe but it doesn’t allow you to have email addresses like @galloway.me.uk – only @me.com. This is a bit pointless for a domain hosting service!

So I looked into Google Apps which is essentially a free equivalent of MobileMe. I’ve found that it’s absolutely amazing. Quick & easy to setup and very easy to use. I’ve had a GMail account for a while, but now I have one setup with my matt at galloway dot me dot uk account. This gives me all the benefits of GMail along with IMAP access, Google Docs, Google Calender, etc, etc, etc.

The dashboard for our new family Google Apps is at http://partnerpage.google.com/galloway.me.uk so check that out. I’ve not quite finished porting everything over, but that should happen sometime this week.

Anyway, thanks Google – very pleased!

UPDATE:
I’ve just finished importing all my old emails from the old server into GMail and it’s worked perfectly. I used Thunderbird to drag across my old folders into my new GMail (using IMAP for both servers). It’s worked like a charm and GMail is even clever enough to sort out duplicate emails by only importing one copy (there were a few duplicates left over from a poor IMAP migration of my server host).

So, everything is going great with Google Apps!

Google Apps