Blog / tips
Share:
Comments: 1

Méthodes privées en Objective-C

En Objective-C, contrairement à de nombreux autres langages orientés objet, le concept de méthode privée n’existe pas en tant que tel. Ce concept peut par contre être implémenté de plusieurs façons. Cet article présente 3 solutions possibles, avec leurs avantages et inconvénients.

Share:
Comments: 1

Closure et fonctions lambda en Objective-C

De nombreux langages de scripts permettent l’utilisation de «fonctions lambdas», ou encore «fonctions anonymes», concept généralement lié au phénomène appelé «closure».
Il s’agit de concepts bien connus notamment en JavaScript, ActionScript, ou encore en PHP depuis sa version 5.3.
Le langage Objective-C offre depuis peu une implémentation de ces deux concepts, appelée «blocks».
Les blocks sont disponibles depuis Mac OS X 10.6 et l’adoption de Clang.

Share:
Comments: 1

Implémentation d’un système de délégation multiple en Objective-C

La délégation est un système présent dans plusieurs classes du framework Cocoa, sous Mac OS X (et donc également sur iPhone OS).
Ce système permet aux dévelopeurs d’applications Cocoa d’interagir en fonction d’événement précis liés aux fonctionnements intrinsèques des objets Cocoa.

De base, le système de délégation ne peut prendre en charge qu’un objet unique. Cet article montre comment implémenter une chaine de délégation dans une classe Objective-C.

Share:
Comments: 1

__toString method is not so magic before PHP 5.2!

This article was originally created by Emilien Vuillaume (Left our team)
With Object Oriented Programmation, it is often useful to display an object quickly and easily.The PHP langage has a magic object method to do that :
class Object{    public function __toString()    {    }}
This method, if it is defined, will be automatically called (magic !) when the Object is displayed.
It’s nice, no ? But if your Php version is prior to 5.2, the magic method is not called !
Example :
class Car{    public $color;

    public function __construct($color = ‘white’)    {       $this->color = $color;    }

    public function __toString()    {        return $this->color . ‘ car’;    }}

$Car    = new Car();$redCar = new Car(‘red’);

echo “There is a ” . $Car . ” and a ” . [...]

Share:
Comments: 0

HOWTO : Get the best out of twitter

You will find lots of best practices and advices to handle your twitter account. I think the basis you should set up, to start with is the following.
Encourage your visitors to publicize your content
ShareThis is a small plugin to add to your site / blog allowing each of your visitors, who liked the post, to publish it in their favorite social network; like facebook profile, twitter, delicious… The easier you make it for people to share what they like, the more they tend to do this little additional click to share. I use this one but their are other tools including, for those using wordpres, native plugins. I found this one smart and easy to configure. [...]