Blog Posts in 'iOS Development'

Fixing 'Invalid Binary - Invalid Signature' on the iOS App Store

While working on a recent iOS App for a client, I ran into a problem after submitting the app to the App Store. Read more to learn about potential ways to fix 'Invalid Binary - Invalid Signature' errors.

Adding charts to your iPhone / iPad App using Core Plot 0.9

It’s unfortunate that Apple do not provide a charting library bundled with their frameworks, for I suspect that would save many developers the trouble of finding a charting library and deciphering the documentation. I’ve come to the conclusion that CorePlot is the best bet at the moment - it’s powerful and compatible with both iOS and OSX but unfortunately the documentation for isn’t great. So, we’re going to go through the process of adding a simple scatter chart to an iPad application.

Wrapping Box2D Debug into a Cocos2D Layer

When I first started integrating Box2D into my Cocos2D project, I found the whole process a little jarring. While I’d used C++ before, this was the first time I’d seen it mixed with Objective-C. This code snippet simply wraps the standard Box2D Debug calls from GLES-Render.h (included with Cocos2D) in it’s own CCLayer, so that you can implement it quickly and easily. It also allows you to turn the layer on an off easily as you would any other CCLayer.

iOS - performSelectorOnMainThread with Multiple Objects

I recently ran into the situation where I wanted to call NSObject’s performSelectorOnMainThread with multiple arguments. While it wasn’t massively difficult, it was a bit more fiddly than I first expected - you have to get your hands dirty with NSInvocation. I’ve built a category that adds an additional method to NSObject which will allow you to call a performSelectorOnMainThread method with any number of objects as parameters. Feel free to use it in your own projects!

Loading Cocos2D Sprite Frame Animations from Plist Files

In a game that a friend and I are working on (Knight Terrors) we wanted a system to pre-load animations into CCAnimationFrameCache without having to hardcode any of that configuration. This means that our designer and artist, Jackson Matthews, can add and remove frames from a creature’s animation without having to come back to me with a frame list to paste back into the code. I will assume you have knowledge of CCSpriteFrameCache and CCAnimations within cocos2d before embarking on this.

Overriding NSObject's description

NSObject is the base / root class for nearly every hierarchy of classes in Objective-C applications. NSObject provides the basic functionality that you take for granted when using Objective-C, such as providing the ability to retain and release objects.

In-App Email through MessageUI Kit

I recently added the ability to an iPhone Application that we have been developing to allow the end-user to send email to their contacts directly from our application. This turned out to be trivial using the MessageUI Kit that Apple provide with the iPhone SDK. Here we detail how we implemented this in our application.

Implementing a Singleton in Objective-C / iOS

There are many pages of discussions around the internet about whether or not you should use global variables in your applications. I’m not going to to into the depths of these discussions, but I have come to live by the following ethos when it comes to using global variables in my application;

Launch Safari with UIApplication openURL

Having devoted much of my time over the last few months developing for the iPhone, I thought it was time to start collecting a small library of useful code snippets here on my blog. I’m mostly posting these for my own use, so that I don’t have to keep searching Google to keep finding the useful bits of code. However, I’ll try to make the posts as accessible as possible, with some explanation where necessary.