10 iPhone Memory Management Tips

Memory management in the iPhone is a hot topic. And since tonight I’m talking about it on tonight’s monthly meetup of the French-speaking Swiss iPhone Developers group, I might as well share some tips here from my own experience.

I won’t go dive through the basics; I think that Scott Stevenson did a great job in his “Learn Objective-C” tutorial at CocoaDevCentral, from where the image below comes. I’m just going to highlight some iPhone-specific issues here and there, and provide some hints on how to solve them.

Continue reading

Objective-C REST Client Update

I’ve uploaded (yet another) update to the Objective-C REST client I’ve blogged about previously. This time I’ve scanned the code with the excellent LLVM/Clang Static Analyzer and fixed a couple of memory leaks here and there. I strongly recommend to scan your own projects with this tool, it’s extremely simple to use:

  1. Install it somewhere in your PATH;
  2. Set your projects to use the Debug configuration when building from the command line (you can do that in the inspector for the project, in the “Configurations” tab); (see Sebastien’s comment below ;)
  3. Open Terminal.app and fire
    scan-build -k -V xcodebuild
    on the root of the Xcode project folder;
  4. If there are any problems with your code, you’ll have your web browser pop up with the list of problems, their description in annotated code format, and even a link to open the file right away.

Continue reading

Of Sowing and Harvests: Subcomandante Marcos’ speech on Gaza

Two days ago, the same day we discussed violence, the ineffable Condoleezza Rice, a US official, declared that what was happening in Gaza was the Palestinians’ fault, due to their violent nature.

The underground rivers that crisscross the world can change their geography, but they sing the same song.

And the one we hear now is one of war and pain.

Not far from here, in a place called Gaza, in Palestine, in the Middle East, right here next to us, the Israeli government’s heavily trained and armed military continues its march of death and destruction.

The steps it has taken are those of a classic military war of conquest: first an intense mass bombing in order to destroy “strategic” military points (that’s how the military manuals put it) and to “soften” the resistance’s reinforcements; next a fierce control over information: everything that is heard and seen “in the outside world,” that is, outside the theater of operations, must be selected with military criteria; now intense artillery fire against the enemy infantry to protect the advance of troop to new positions; then there will be a siege to weaken the enemy garrison; then the assault that conquers the position and annihilates the enemy, then the “cleaning out” of the probable “nests of resistance.”

The military manual of modern war, with a few variations and additions, is being followed step-by-step by the invading military forces.

We don’t know a lot about this, and there are surely specialists in the so-called “conflict in the Middle East,” but from this corner we have something to say: Continue reading

6 mil millones de otros

Todo arrancó con un desperfecto del helicóptero, un día, en Mali. Esperando al piloto, me puse a charlar con un paisano durante todo un día. Me habló de su vida, de sus esperanzas, de sus miedos. Su unica ambición era poder alimentar sus hijos. Habiendo interrumpido forzosamente mi trabajo para una revista, me zambullí en los problemas más elementales. Y él me miraba directo a los ojos, sin queja, sin pedido, sin resentimiento. Me había ido a fotografiar paisajes, pero me cautivaron su cara, sus palabras. Luego, sobrevolando el planeta para realizar mi proyecto ‘La Tierra Vista del Cielo’, me preguntaba seguido lo que podría aprender de los hombres y mujeres que percibía debajo de mí. Soñaba poder escuchar sus palabras, oir lo que nos une. Porque vista desde lo alto, la tierra aparece como una extensión inmensa para compartir. Pero apenas despues de aterrizar, los problemas comenzaban. Me encontraba confrontado a la rigidez de las administraciones de cada país, y sobre todo a la realidad de las fronteras instauradas por los hombres, símbolo de esta dificultad de vivir juntos. Vivir juntos… Vivimos una época increíble. Todo va a una velocidad de locos. Tengo sesenta años y cuando pienso en la manera en la que comunicaban mis padres, apenas se puede creer. Tenemos hoy a nuestra disposición herramientas de comunicación extraordinarias: podemos ver y saber todo, y la masa de información en circulación jamás fue tan grande. Todo esto es muy positivo. La ironía es que, al mismo tiempo, seguimos conociendo muy poco nuestros vecinos. Hoy, sin embargo, la única posibilidad es ir hacia el Otro. Comprenderlo. Porque en todos los combates que se avecinan, ya sea en la pobreza o los cambios climáticos, no podremos actuar solos. El tiempo en el que podíamos permitirnos pensar solo en nosotros mismos, o en nuestras comunidades restringidas se ha acabado. De ahora en más, no podemos ignorar lo que nos une y las responsabilidades que eso presupone. Somos más de 6 mil millones en la Tierra, y no habrá desarrollo durable si no podemos llegar a vivir juntos. Es por eso que ’6 Mil Millones de Otros’ es tan importante para mí. Creo en ello ya que nos concierne a todos y cada uno, y porque es una incitación a actuar. Espero que luego, cada cual tenga ganas de encontrar gente, de escuchar al Otro, y de contribuir a ’6 Mil Millones de Otros’ agregando su testimonio para expresar las ganas de vivir juntos.

http://www.6milliardsdautres.org/

Best books of 2008

You might remember my beloved mantras: learning a new programming language and reading at least 6 relevant books every year. Following the 2007 edition, here’s the list of the 8 books I have enjoyed most in 2008, ordered by a purely subjective and absolutely irrational decreasing preference. I strongly recommend all of them!

Winner: Geekonomics: The Real Cost of Insecure Software by David Rice

Runner-up: The No Asshole Rule: Building a Civilized Workplace and Surviving One That Isn’t by Robert I. Sutton, PhD

And 6 more:

Continue reading