Posts Tagged 'Programming'

Introduction to NEON

So if you have any need for hardcore DSP-type stuff in your iPhone app, and you don’t already know all about the ARM® NEON™ engine, here is the article for you:

Introduction to NEON on iPhone

A sometimes overlooked addition to the iPhone platform that debuted with the iPhone 3GS is the presence of an SIMD engine called NEON. Just like AltiVec for PowerPC and MMX/SSE for x86, this allows multiple computations to be performed at once on ARM, giving an important speedup to some algorithms, on condition that the developer specifically codes for it.

Given that, among the iPhone OS devices, only the iPhone 3GS and the third-gen iPod Touch featured NEON up until recently, it typically wasn’t worth the effort to work on a NEON optimization, given that it would benefit only these devices, unless the application could require running on one of them (e.g. because its purpose is to processes videos recorded by the iPhone 3GS). However, with the arrival of the iPad it makes much more sense to develop NEON optimizations. In this post I’ll try to give you a primer on NEON…

Good stuff, good stuff. Now, for most of us, no doubt the Accelerate framework publicly announced for OS 4.0 is going to cover most everything we’re going to have any probable use for, but hey, if you’re really hardcore … this is what you need!

Continue Reading →


If you’ve done any work with the Keychain, you’ve no doubt noticed that it’s not the most elegant of APIs. Here is EMKeychain to fix that for you:

EMKeychain is a Cocoa wrapper class for Keychain, which has unfortunately been frozen in carbonite. It’s much cleaner than interfacing with keychain yourself, is actively used in commercial-grade products, and is completely documented.

Haven’t tried it ourselves just yet, but hey it seems like nice work!

Continue Reading →

BDD Testing: Cedar

So let’s say you’re interested in Behaviour-Driven Development testing of your iPhone projects. But there isn’t anything to help out Objective-C like all the cool kids have, you say? Not so! Here is your introduction to Cedar:

BDD-style testing using Objective-C

… One of the things I found I miss most in testing Objective-C, Java, or C++, is the hierarchical structure for organizing tests that frameworks like RSpec or Jasmine provide. I find nested describes indispensable for managing orthogonal aspects of the classes under test, for handling preconditions, for eliminating redundant setup code, and for generally keeping my sanity. So, when I first heard about the addition of blocks in the GCC compiler for Objective-C the first application that came to mind was testing.

So, I wrote Cedar, a BDD-style framework for writing tests in Objective-C. The code is available here. Perhaps more importantly, Cedar is in its infancy so I’m interested in any suggestions and feedback. To that end, I created a public Tracker project for it here

and a followup post correcting people who thought it wouldn’t work for iPhone development:

BDD-style testing for iPhone projects

… I actually wrote Cedar specifically for testing iPhone OS projects we’re working on at Pivotal. To prove it, I’ve started a small public iPhone project that I’ve test-driven entirely with Cedar. You can get the project here (more on that in a bit); it should eventually allow you to log into Pivotal Tracker, see all the delivered stories in a given project, and accept or reject each one…

So that looks like that might be an interesting new development style to take up. Although, at this exact point in time, one might wait for that currently-NDA’d version of Xcode to be released before making any firm commitments…

h/t: iPhoneFlow!

Continue Reading →

cocos2d + Tiled

Well, looks like tutorial maestro Ray Wenderlich has another exhaustively detailed production for us, this time detailing the Tiled Map Editor along with cocos2d that we’d noticed before looked like an intriguing development environment, in

How To Make a Tile Based Game with Cocos2D

Collisions and Collectables: How To Make a Tile Based Game with Cocos2D Part 2

Good stuff, good stuff. For more relevant information, check out

cocos2d wiki — Tiled Maps

Tiled wiki

and if you haven’t already, check out all his other cocos2d tutorials while you’re over there:

How To Make A Simple iPhone Game with Cocos2D Tutorial

Rotating Turrets: How To Make A Simple iPhone Game with Cocos2D Part 2

Harder Monsters and More Levels: How To Make A Simple iPhone Game with Cocos2D Part 3

How To Create Buttons in Cocos2D: Simple, Radio, and Toggle

Intro to Box2D with Cocos2D Tutorial: Bouncing Balls

How To Create A Breakout Game with Box2D and Cocos2D Tutorial: Part 1/2

How To Create A Breakout Game with Box2D and Cocos2D Tutorial: Part 2/2

How To Use Box2D For Just Collision Detection with Cocos2D iPhone

Quite the collection, indeed!

Continue Reading →

UIScrollView Menu

Here’s a detailed howto on implementing a useful-looking UI widget extension:

Digital Post, my newspaper app for the iPad, uses a number of custom user interface elements to build out the full user experience. One of these custom components is a horizontal topic selector that you can swipe and also tap to select individual topics…


Not terribly complicated, but a nice implementation, featuring just how easy it is to use UITapGestureRecognizer.

Continue Reading →

Tip: UITabBar Tint

So you may have noticed that unlike most controls in UIKit, there’s no way to mess with the tint color of a UITabBar. But let’s say you really really want to make your UITabBar look different: well, from the people who brought you that nifty BarTint tool, here’s how to go about that:

CGSize tabBarSize = [tabBar frame].size;
tabBarFakeView = [[UIView alloc] initWithFrame:
CGRectMake(0,0,tabBarSize.width, tabBarSize.height)];
[tabBar insertSubview:tabBarFakeView atIndex:0];
[tabBarFakeView setBackgroundColor:[UIColor redColor]];

… and apparently the buttons will get drawn acceptably on top of whatever color/image/whatever you stick a view in there for. We’d be just a teensy little bit nervous that the SDK Police might consider this “undocumented API”, having encountered issues of that sort before, but hey, if somebody really really wants their UI to look just so, there you go!

Continue Reading →

Instant Translation

Think it’d be neat to embed Google Translate facilities directly into your app? Well, in case you didn’t know, there’s a public AJAX Language API for that, and it’s pretty dead simple to put into your iPhone app:

Google Translate and iPhone apps

Only available while online of course, and chances are that there’s licensing restrictions that you’d better be aware of, but hey, free insta-translation of any sort is pretty nifty!


Ray Wenderlich now has, of course, a detailed tutorial on the subject:

How To Translate Text With Google Translate and JSON on the iPhone

Continue Reading →

Syntax Coloring

Here’s a good start for you if you’re tasked with writing a syntax coloring editor: The “vital pulp” (as they put it) of text editor Smultron, now being further developed as a fork named Fraise, is now packaged up as an Apache-licensed framework named Fragaria. (Where do they get these names from?)

NSTextView-based, so not of immediate application to your iDevice coding, but hey it’s something!

h/t: cocoadev!

Continue Reading →

Pull-To-Reload UITableView

So this may be old news to you, but the official iPhone Twitter client (née Tweetie 2) has a super-nifty interface enhancement where to reload your tweets you pull down the top of the list and it gives you a prompt to refresh. Pretty cool, huh?

Well, here’s an explanation with complete source of how to add it to your own projects!

How to make a Pull-To-Reload TableView just like Tweetie 2

Working implementation available for €20 with the My App Sales source, if you’d like that, but like most things, it’s pretty straightforward once someone shows you how.

… and apropos of discussing things Twitterish, should your image there be of large concern to you, you might find amusing/educational this semi-rant: Elements Of Twitter Style. Whilst personally we haven’t actually embraced Twitter past installing Duane’s nifty WordTwit plugin to treat it as an alternative RSS feed essentially, we’ve grudgingly acquiesced that there are some feeds out there with enough interesting content to bother devoting a modicum of attention to. Yeah, we know, doesn’t sound very much like a troll, getting involved in anything social media-ish, does it. Cha, what next, signing up for Facebook? The horror!


Here’s another simple and free implementation: iPhone Pull to Refresh!

And another: EGOTableViewPullRefresh!

Yet another: SSPullToRefresh!

h/t: @rwenderlich!

Continue Reading →

C99 Tricks

So you think you know the C programming language? Well, we’ll just betcha that you’ll find out something new by checking out

Fun with C99 Syntax

The C99 language added some pretty neat features to the ANSI C we know and love (now known as C89). I used a construct called compound literals in my iPad Dev Camp presentation, and it seemed new to a lot of people. Here’s a summary of some lesser known features about C99 that are worth knowing. And, since Objective-C is a strict superset of C, all this applies to Objective-C, as well. Best of all, as of recent Xcode (3.0? 3.1?), C99 is the default C dialect for new projects, so you don’t need to do anything to start taking advantage of these…

Continue Reading →
Page 60 of 93 «...3040505859606162...»