Comparing a file

So I’ve been hard at work again today going through a some iOS tutorials.

Making silly mistakes as usual but hey, best way to learn.

Ran an app and wasn’t getting the results I need so I tracked down where it was, couldn’t figure it out so copied the solution code into my code, ran it and it worked. Clearly I can’t copy from a webpage into Xcode.

Looked at the code, compared it, compared it line by line, looked at it again and still couldn’t work it out.

So this got me thinking there must be file comparison tools out there.

I did a quick search on google and there are many but I didn’t want to download any, there must be an online solution.
I found a blog that suggested using Google Docs, create a new doc, paste in the code, save it,  delete the code, paste in the second lot of code, save it,  now click on File -> See revision history.
Now this should show up the changes, wasn’t quite what I wanted, unless I was looking at it wrong, but may come in useful somewhere down the line.

Next I found it could be done in the terminal.

Comm a.txt b.txt

The result was quite complex looking as I haven’t worked in the terminal for a few years, should probably get back there as it is very powerful and much quicker than windows based alternatives, although they have their place.
I think the columns the text was in denoted whether it was the same or not depending on the file.

Next I did a quick search for it in Textmate and there it was in a bundles – Bundles -> Diff

Hazarr saved both versions, sample and my incorrect attempt, Bundles -> Diff -> Document with Arbitrary file … and there appears a colourful version showing what is different.

Guess what, I copied a line wrong and couldn’t see for looking!

Serves me right for copying the initial [playerElement addChild:nameElement]; and only changing the RHS and not checking the LHS.

Well this lesson has taught me a few new things in different programs so has had some use.


RW Beginning iPhone Programming Finished

So I’ve finished the first set of tutorials on and it’s making sense which is always good.

Haven’t tried a project of my own implementing them yet so lets hold up before I say it’ll make sense then.

To finish them off there was Memory Management, Debugging and Properties.

The forum has been most helpful, quick responses at very noob questions, they have a lot of patience.

I’ve even got a help thread started for my Sokoban game I’d like to create.
I need to get to grips with ObjC before I make a start but lets hope people vote for it in after my tutorial suggestion was added to the thread.

I voted for the A* search tut which I though would be a good one to create a Sokoban Solver as another project.
This could be used to check levels I have created are actually solvable.
It could also be used to help users if they get stuck.

There are many solvers out there, even suppling their source code, might be worth a look

iOS Programming – iTunes File Sharing & Emailing a File

So I’ve spent some of the day integrating the iTunes File Sharing and then how to Import/Export that File, also adding that option through an email.

Got an error in the iTunes File Sharing when I came to build it, don’t think I added a library correctly, gonna have a look tomorrow so I’ve had some time away from the code.

Used the sample one to continue with the Email tutorial and that worked great!

This can be reused anyway and everywhere, can’t wait to try it out.


iOS Programming – Saving Data with NSCoding and NSFileManager

So the next chapter in the tutorials by Ray Wenderlich has taught me how to save data to the device so it will be shown next time I open the app.

Looking forward to using this in further projects.


Scary Bugs Part 3/3 Completed

So that’s part 3 completed.

I can now delete bugs, add new ones and amend the details.

There is a loading screen to inform the user that the program is busy and hasn’t crashed.

Next up is saving the data.


Ray Wenderlich Scary Bug Part 2/3 Completed

Completed Part 2/3 of the Scary Bugs tutorial.

Added the detail view this time so you could see bug, rate it and change it’s name.


Made a silly mistake and copied a few lines of code, forgot to re-name a few variables so the rating didn’t work, didn’t take long to realise though. Lesson learned hopefully 😛


First Ray Wenderlich Tutorial Completed

Just finished the first tutorial on Ray Wenderlich’s excellent website.

This one started adding a table view of bugs with a thumbnail image:

Scary Bug - Table View

Can’t wait to work on more of them.