iOS Archives

These posts are syndicated from my iOS Dev Diary over at pinkstone.co.uk.

The format is slightly different with more code snippets and less explanations. I had originally designed it as a notebook in iOS Development – now you can follow along if you’re interested.

How to fix Core Data error: “Receiver type xxx for instance message is a forward declaration”

Core Data is great. But when you add it to an existing project Xcode throws some random error messages at you that make you doubt your sanity. Again. Legitimately copied and pasted code from Apple’s own templates generates totally useless errors such as Receiver type ‘NSManagedObjectContext’ for instance message is a forward declaration. This isn’t […]

How to add 64bit support to your iOS apps

Apple’s new A7 processors support 64bit under iOS 7 – but only if your app is specifically compiled for 64bit. Ideally you want to compile once and use 64bit if the architecture supports, and if not use 32bit for devices that have A4 – A6x processors. Since Xcode 5.0.2 you can do this, and here’s […]

How to react to multiple UIAlertViews

If your class creates more than one UIAlertView, then you need a way to react to each of those accordingly. Problem is, you may only have one delegate that listens to all alerts at any given time. You could of course create a separate class for each alert view, but that’s a bit overkill. Instead, […]

How to determine screen size in iOS

The UIDevice class can help us do that like so: [super viewDidLoad]; // lets detect the height of our screen here int height = [UIScreen mainScreen].bounds.size.height; int width = [UIScreen mainScreen].bounds.size.width; // share the news NSString *message = [[NSString alloc]initWithFormat:@”This screen is \n\n%i pixels high and\n%i pixels wide”, height, width]; NSLog(@”%@”, message); This will work […]