This is a flocking class I created for iPhone.
After a 20 seconds or so you can see how they interact and push/pull from each other.
I've created an example project with this class, which can be downloaded here:
Loading more stuff…
Hmm…it looks like things are taking a while to load. Try again?